bugGNU Octave - Bugs: bug #66619, [octave-forge]...

 
 

bug #66619: [octave-forge] (instrument-control) readline uses the wrong termination when specified with configureTerminator

Submitter:  Michael Asam <stromi>
Submitted:  Mon 30 Dec 2024 04:18:46 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  lostbard
Originator Name:  Open/Closed:  * Closed
Release:  * 9.3.0 Release: 
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 Jan 2025 12:41:59 PM UTC, comment #2: 

Version 0.9.4 has been released, including this fix.

John Donoghue <lostbard>
Group Member
Sat 18 Jan 2025 03:08:50 PM UTC, comment #1: 

Thanks for the report and research/findings.

I pushed up a change to the repo with the fix, so it will appear in the next release of the package.

John Donoghue <lostbard>
Group Member
Mon 30 Dec 2024 04:18:46 PM UTC, original submission:  

When specifying individual terminators for reading and writing data to an instrument, the command 'readline' from the package instrument-control (version 9.3) uses the same termination as 'writeline'.

Example:

Connection = tcpclient("192.168.188.56", 23); % Establish connection via TCP/IP
configureTerminator(Connection, "LF", "CR");  % Termination should be "LF" for reading, and "CR" for writing
% Let's check the terminators:
Connection.Terminator


So far everything is as expected. But the 'readline' command uses not the first of those terminators but the second, i.e. it uses the one which is just for 'writeline':


writeline(Connection, "*IDN?");  % Uses 'CR' as terminator --> correct
readline(Connection)             % Uses also 'CR' as terminator, but it should use 'LF'


The problem is caused in the file readline.m, where the second terminator is chosen:

    terminator = dev.Terminator;
    if iscell(terminator) && length(terminator) > 1
      terminator = terminator{2};
    endif


Correct would be to choose the first terminator:

      terminator = terminator{1};


Michael Asam <stromi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by stromi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-01-20 lostbard StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2025-01-18 lostbard StatusNone Ready For Test
        Assigned toNone lostbard
    2024-12-30 philipnienhuis Summaryreadline uses the wrong termination when specified with configureTerminator [octave-forge] (instrument-control) readline uses the wrong termination when specified with configureTerminator

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code