Changeset 303

Show
Ignore:
Timestamp:
09/25/08 16:51:10 (5 years ago)
Author:
atorf
Message:
  • Adapted more functions (mostly Open*) to work with optional NXT handle
  • Modified various minor bugs and help texts
Location:
branches/atorf/RWTHMindstormsNXT
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • branches/atorf/RWTHMindstormsNXT/COM_ReadI2C.m

    r293 r303  
    3030%    many other sensors, the "data section" starts at 0x42 (66 in decimal). 
    3131% 
    32 %    As last argument you can pass a valid NXT-handle to be used from this 
     32%    As last argument you can pass a valid NXT-handle to be used by this 
    3333%    function. If no handle is passed, the default set by 
    34 %    |COM_SetDefaultNXT will be used. 
    35 % 
    36 %    *Returns:* |ReturnBytes|, byte-array (column vector) of uint8 
     34%    |COM_SetDefaultNXT| will be used. 
     35% 
     36%    *Returns:* |ReturnBytes|, byte-array (column vector) of uint8. 
    3737%    This array contains the raw sensor-data you requested. How to 
    3838%    interpret them depends on the sensor. If communication failed (even 
     
    169169        % note that we suppress statusbyte-error-warnings by requesting the 
    170170        % 3rd optional output argument of NXT_LSRead() 
    171         [data BytesRead status] = NXT_LSRead(Port); 
     171        [data BytesRead status] = NXT_LSRead(Port, handle); 
    172172 
    173173                
  • branches/atorf/RWTHMindstormsNXT/CalibrateCompass.m

    r299 r303  
    11function [ok] = CalibrateCompass(port, f_start, varargin) 
    2 % Enables or calibration mode of the HiTechnic compass sensor 
     2% Enables calibration mode of the HiTechnic compass sensor 
    33% 
    44% Syntax 
     
    2626% 
    2727% Example 
    28 %  
     28% 
     29% 
     30%+     % compass must be open for calibration 
     31%+     OpenCompass(SENSOR_2);  
     32%+ 
    2933%+     % enable calibration mode 
    3034%+     CalibrateCompass(SENSOR_2, true); 
     
    4145%+     CalibrateCompass(SENSOR_2, false); 
    4246% 
    43 % See also: OpenCompass, CloseSensor, NXT_LSRead, NXT_LSWrite 
     47% See also: OpenCompass, GetCompass, CloseSensor, NXT_LSRead, NXT_LSWrite 
    4448% 
    4549% Signature 
  • branches/atorf/RWTHMindstormsNXT/GetCompass.m

    r299 r303  
    2626%+   CloseSensor(SENSOR_4); 
    2727% 
    28 % See also: OpenCompass, CalibrateCompass CloseSensor, COM_ReadI2C 
     28% See also: OpenCompass, CalibrateCompass, CloseSensor, COM_ReadI2C 
    2929% 
    3030% Signature 
  • branches/atorf/RWTHMindstormsNXT/GetUltrasonic.m

    r299 r303  
    1010%   |distance = GetUltraSonic(port)| returns the current measurement value |distance| of the NXT 
    1111%   ultrasonic sensor. |distance| represents the measured distance in cm. 
     12%   If no echo can be detected (which could indicate that either there is 
     13%   no obstacle in the way, or the ultrasound does not get reflected, e.g. 
     14%   by fur-like surfaces), the reading will be 255. If no measurement can 
     15%   be made (defect sensor, cable disconnected, etc.), a value of -1 will 
     16%   be returned. 
     17% 
    1218%   The given |port| number specifies the connection port. The value |port| can be 
    1319%   addressed by the symbolic constants |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to 
  • branches/atorf/RWTHMindstormsNXT/MotorRotateAbs.m

    r123 r303  
    1 function MotorRotateAbs(whatmotor,abs_angle,power) 
     1function MotorRotateAbs(whatmotor,abs_angle,power, varargin) 
    22% Rotates a motor to an absolute angle 
    33 
    44% Syntax 
    55%   |MotorRotateAbs(port,abs_angle,power)|  
     6% 
     7%   |MotorRotateAbs(port,abs_angle,power, handle)|  
    68% 
    79% Description 
     
    1012%   |MOTOR_C| analog to the labeling on the NXT Brick. The |angle| determines the absolute angle to 
    1113%   rotate. |power| represents the motor power (|1...100|). 
     14% 
     15%   The last optional argument can be a valid NXT handle. If none is 
     16%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     17%   set one). 
    1218% 
    1319% Note: 
     
    2026% 
    2127% Signature 
    22 %   Author: Robter Schwann, Bernd Neumann (see AUTHORS) 
     28%   Author: Robert Schwann, Bernd Neumann (see AUTHORS) 
    2329%   Date: 2007/10/15 
    2430%   Copyright: 2007-2008, RWTH Aachen University 
     
    4147% *********************************************************************************************** 
    4248 
     49% check if handle is given; if not use default one 
     50if nargin > 4 
     51    handle = varargin{1}; 
     52else 
     53    handle = COM_GetDefaultNXT; 
     54end%if 
     55 
    4356if power<=0 
    4457    error('MATLAB:RWTHMindstormsNXT:Motor:invalidPower', ... 
     
    4760end 
    4861 
    49 out = GetMotorSettings(whatmotor); 
     62out = GetMotorSettings(whatmotor, handle); 
    5063% physical angle the motor actually has to go 
    5164angle_to_go = abs_angle - out.TachoCount; 
    5265 
    5366% relative angle (for motor command) 
    54 rel_angle = abs_angle - GetMemoryCount(whatmotor); 
    55 SetMemoryCount(whatmotor, abs_angle); 
     67rel_angle = abs_angle - GetMemoryCount(whatmotor, handle); 
     68SetMemoryCount(whatmotor, abs_angle, handle); 
    5669 
    5770if sign(rel_angle)*sign(angle_to_go)>0 || angle_to_go==0 
    5871    if rel_angle~=0 
    5972        NXT_SetOutputState(whatmotor,power*sign(rel_angle),1,1,... 
    60             'SPEED',0,'RUNNING',abs(rel_angle),'dontreply'); 
     73            'SPEED',0,'RUNNING',abs(rel_angle),'dontreply', handle); 
    6174    end 
    6275else 
    6376     NXT_SetOutputState(whatmotor,-power*sign(angle_to_go),1,1,... 
    64          'SPEED',0,'RUNNING',abs(rel_angle)+1,'dontreply'); 
     77         'SPEED',0,'RUNNING',abs(rel_angle)+1,'dontreply', handle); 
    6578     NXT_SetOutputState(whatmotor,power*sign(angle_to_go),1,1,... 
    66          'SPEED',0,'RUNNING',1,'dontreply'); 
     79         'SPEED',0,'RUNNING',1,'dontreply', handle); 
    6780end 
  • branches/atorf/RWTHMindstormsNXT/NXT_LSRead.m

    r289 r303  
    77%   |[data BytesRead] = NXT_LSRead(port, handle)|  
    88% 
    9 %   |[data BytesRead optionalStatusByte] = NXT_LSRead(port, [handle])|  
     9%   |[data BytesRead optionalStatusByte] = NXT_LSRead(port)|  
     10% 
     11%   |[data BytesRead optionalStatusByte] = NXT_LSRead(port, handle)|  
    1012% 
    1113% Description 
     
    2628%   argument is still optional, like above. 
    2729% 
    28 %   If no Bluetooth handle is specified the default one (|COM_GetDefaultNXT|) is used. 
     30%   If no NXT handle is specified the default one (|COM_GetDefaultNXT|) is used. 
    2931% 
    3032% 
  • branches/atorf/RWTHMindstormsNXT/NXT_MessageWrite.m

    r291 r303  
    1515%     |mailbox|. If no mailbox is specified, default one is 0 (zero) 
    1616% 
    17 %   |NXT_MessageWrite(message, mailbox, handle)| uses the given Bluetooth 
    18 %     connection |handle|. This should be a serial handle on a Windows 
    19 %     platform and a file handle on a Linux one. If no Bluetooth handle is 
    20 %     specified, default one (|COM_GetDefaultNXT()|) is used. 
     17%   |NXT_MessageWrite(message, mailbox, handle)| uses the given NXT 
     18%   connection |handle|. If no handle is specified, the default one 
     19%   (|COM_GetDefaultNXT()|) is used. 
    2120% 
    2221% Examples: 
     
    2827%+  NXT_MessageWrite('F010045', 0, handle); 
    2928% 
    30 % See also NAME2COMMANDBYTES, COM_CREATEPACKET, COM_SENDPACKET 
     29% See also: COM_CreatePacket, COM_SendPacket 
    3130% 
    32 % Copyright 2007-2008, The MathWorks SAS (France) 
    33 % Writen by Laurent Vaylet, 2008/09/24 
     31% Signature 
     32%   Author: Laurent Vaylet, The MathWorks SAS (France) (see AUTHORS) 
     33%   Date: 2008/09/24 
     34%   Copyright: 2007-2008, RWTH Aachen University 
     35% 
    3436; 
    3537% 
  • branches/atorf/RWTHMindstormsNXT/OpenAccelerator.m

    r291 r303  
    11function OpenAccelerator(port, varargin) 
    2 % Initializes and sets the mode of the NXT accelerator sensor 
     2% Initializes and sets the mode of the HiTechnic acceleration sensor 
    33% 
    44% Syntax 
    55%   |OpenAccelerator(port)| 
    66% 
     7%   |OpenAccelerator(port, handle)| 
    78% 
    89% Description 
     
    1112%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. 
    1213% 
     14%   The last optional argument can be a valid NXT handle. If none is 
     15%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     16%   set one). 
    1317% 
    1418% Examples 
     
    1721%+   CloseSensor(SENSOR_4); 
    1822% 
    19 % See also: GetAccelerator, CloseSensor, NXT_LSGetStatus, NXT_LSRead 
     23% See also: GetAccelerator, CloseSensor, COM_ReadI2C, NXT_LSGetStatus, NXT_LSRead 
    2024% 
    2125% Signature 
     
    4145% *********************************************************************************************** 
    4246 
    43 %% Parameter check 
     47%% Parameter check     
     48 
     49    % check if handle is given; if not use default one 
     50    if nargin > 1 
     51        handle = varargin{1}; 
     52    else 
     53        handle = COM_GetDefaultNXT; 
     54    end%if 
     55     
    4456    % also accept strings as input 
    4557    if ischar(port) 
     
    4759    end%if 
    4860     
    49     NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     61    NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply', handle); 
    5062 
    5163% %% Build hex command and send it with NXT_LSWrite    
     
    6678    % the following command sequence is not clearly documented but was 
    6779    % found to work well! 
    68         NXT_LSGetStatus(port); % flush out data with Poll 
    69         NXT_LSRead(port);      % flush out data with Poll? 
    70  
     80        NXT_LSGetStatus(port, handle); % flush out data with Poll 
     81    % we request the status-byte so that it doesn't get checked. 
     82    % errors that can occur here are: 
     83    %Packet (reply to LSREAD) contains error message 221: "Communication bus error" 
     84    %Packet (reply to LSREAD) contains error message 224: "Specified 
     85    %channel/connection not configured or busy" 
     86        [a b c] = NXT_LSRead(port, handle);      % flush out data with Poll? 
    7187end 
  • branches/atorf/RWTHMindstormsNXT/OpenCompass.m

    r298 r303  
    1 function OpenCompass(port) 
    2 % Initializes and sets the mode of the NXT compass sensor 
     1function OpenCompass(port, varargin) 
     2% Initializes and sets the mode of the HiTechnic magnetic compass sensor 
    33% 
    44% Syntax 
    55%   |OpenCompass(port)| 
    66% 
     7%   |OpenCompass(port, handle)| 
    78% 
    89% Description 
    9 %   |OpenCompass(port)| initializes the input mode of NXT compass sensor specified by the sensor 
     10%   |OpenCompass(port)| initializes the input mode of HiTechnic compass sensor specified by the sensor 
    1011%   port. The value |port| can be addressed by the symbolic constants 
    1112%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. 
    1213% 
    13 %   With |GetCompass(port)| you receive the handing value ranging from 0 to 359. 
     14%   With |GetCompass(port)| you can receive the heanding value ranging from 0 to 359. 
    1415%    
    15 %   Since the NXT compass sensor is a digital sensor (that uses the I²C protocol), 
     16%   The last optional argument can be a valid NXT handle. If none is 
     17%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     18%   set one). 
     19% 
     20%   Since the compass sensor is a digital sensor (that uses the I²C protocol), 
    1621%   the function |NXT_SetInputMode| cannot be used as for analog sensors. 
    1722% 
     
    2227%+   CloseSensor(SENSOR_2); 
    2328% 
    24 % See also: GetCompass, CloseSensor, NXT_LSGetStatus, NXT_LSRead 
     29% See also: GetCompass, CloseSensor, COM_ReadI2C, NXT_LSGetStatus, NXT_LSRead 
    2530% 
    2631% Signature 
     
    4752 
    4853%% Parameter check 
     54 
     55    % check if handle is given; if not use default one 
     56    if nargin > 1 
     57        handle = varargin{1}; 
     58    else 
     59        handle = COM_GetDefaultNXT; 
     60    end%if 
     61 
    4962    % also accept strings as input 
    5063    if ischar(port) 
     
    5265    end%if 
    5366 
    54     NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     67    NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply', handle); 
    5568 
    5669     
     
    5871    % the following command sequence is not clearly documented but was 
    5972    % found to work well! 
    60         NXT_LSGetStatus(port); % flush out data with Poll 
     73        NXT_LSGetStatus(port, handle); % flush out data with Poll 
    6174    % we request the status-byte so that it doesn't get checked. 
    6275    % errors that can occur here are: 
     
    6477    %Packet (reply to LSREAD) contains error message 224: "Specified 
    6578    %channel/connection not configured or busy" 
    66         [a b c] = NXT_LSRead(port);      % flush out data with Poll? 
     79        [a b c] = NXT_LSRead(port, handle);      % flush out data with Poll? 
    6780end%function 
  • branches/atorf/RWTHMindstormsNXT/OpenInfrared.m

    r291 r303  
    11function OpenInfrared(port, varargin) 
    2 % Initializes and sets the mode of the NXT infrared seeker sensor 
     2% Initializes and sets the mode of the HiTechnic infrared seeker sensor 
    33% 
    44% Syntax 
    55%   |OpenInfrared(port)| 
    66% 
     7%   |OpenInfrared(port, handle)| 
    78% 
    89% Description 
    9 %   |OpenInfrared(port)| initializes the input mode of NXT infrared seeker sensor specified by the sensor 
     10%   |OpenInfrared(port)| initializes the input mode of HiTechnic infrared seeker sensor specified by the sensor 
    1011%   |port|. The value |port| can be addressed by the symbolic constants 
    1112%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. 
    1213% 
     14%   The last optional argument can be a valid NXT handle. If none is 
     15%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     16%   set one). 
    1317% 
    1418% Examples 
     
    4246 
    4347%% Parameter check 
     48 
     49    % check if handle is given; if not use default one 
     50    if nargin > 1 
     51        handle = varargin{1}; 
     52    else 
     53        handle = COM_GetDefaultNXT; 
     54    end%if 
     55     
    4456    % also accept strings as input 
    4557    if ischar(port) 
     
    4759    end%if 
    4860     
    49     NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     61    NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply', handle); 
    5062 
    5163% %% Build hex command and send it with NXT_LSWrite    
     
    6678    % the following command sequence is not clearly documented but was 
    6779    % found to work well! 
    68         NXT_LSGetStatus(port); % flush out data with Poll 
    69         NXT_LSRead(port);      % flush out data with Poll? 
    70  
     80        NXT_LSGetStatus(port, handle); % flush out data with Poll 
     81    % we request the status-byte so that it doesn't get checked. 
     82    % errors that can occur here are: 
     83    %Packet (reply to LSREAD) contains error message 221: "Communication bus error" 
     84    %Packet (reply to LSREAD) contains error message 224: "Specified 
     85    %channel/connection not configured or busy" 
     86        [a b c] = NXT_LSRead(port, handle);      % flush out data with Poll? 
    7187end 
  • branches/atorf/RWTHMindstormsNXT/OpenLight.m

    r123 r303  
    1 function OpenLight(f_sensorport, f_mode) 
     1function OpenLight(f_sensorport, f_mode, varargin) 
    22% Sets the parameter mode of the NXT light sensor 
    33% 
    44% Syntax 
    55%   |OpenLight(port, mode)| 
     6% 
     7%   |OpenLight(port, mode, handle)| 
    68% 
    79% Description 
     
    1214%   (passive illumination red light off). To deactive the active illumination the function 
    1315%   |CloseSensor| is used. 
     16% 
     17%   The last optional argument can be a valid NXT handle. If none is 
     18%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     19%   set one). 
    1420% 
    1521%   For more complex settings the function |NXT_SetInputMode| can be used. 
     
    4551 
    4652%% Check Parameter 
     53    % check if handle is given; if not use default one 
     54    if nargin > 2 
     55        handle = varargin{1}; 
     56    else 
     57        handle = COM_GetDefaultNXT; 
     58    end%if 
     59 
    4760    if ~strcmpi(f_mode, 'ACTIVE') && ~strcmpi(f_mode, 'INACTIVE') 
    4861        error('MATLAB:RWTHMindstormsNXT:Sensor:invalidMode', 'Light sensor mode has to be ''ACTIVE'' or ''INACTIVE'''); 
     
    6275     
    6376%% Call NXT_SetInputMode function 
    64     NXT_SetInputMode(f_sensorport, sensortype, sensormode, 'dontreply');  
     77    NXT_SetInputMode(f_sensorport, sensortype, sensormode, 'dontreply', handle);  
    6578 
    6679end%function 
  • branches/atorf/RWTHMindstormsNXT/OpenSound.m

    r123 r303  
    1 function OpenSound(f_sensorport, f_mode) 
     1function OpenSound(f_sensorport, f_mode, varargin) 
    22% Sets the parameter mode of the NXT sound sensor 
    33% 
    44% Syntax 
    55%   |OpenSound(port, mode)| 
     6% 
     7%   |OpenSound(port, mode, handle)| 
    68% 
    79% Description 
     
    1012%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. The 
    1113%   |mode| represents one of two modes |'DB'| (dB measurement) and |'DBA'| (dBA measurement) 
     14% 
     15%   The last optional argument can be a valid NXT handle. If none is 
     16%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     17%   set one). 
    1218% 
    1319%   For more complex settings the function |NXT_SetInputMode| can be used. 
     
    4349 
    4450%% Check Parameter 
     51    % check if handle is given; if not use default one 
     52    if nargin > 2 
     53        handle = varargin{1}; 
     54    else 
     55        handle = COM_GetDefaultNXT; 
     56    end%if 
     57     
    4558    if ~strcmpi(f_mode, 'DB') && ~strcmpi(f_mode, 'DBA') 
    4659        error('MATLAB:RWTHMindstormsNXT:Sensor:invalidMode', 'Sound sensor mode has to be ''DB'' or ''DBA'''); 
     
    6073     
    6174%% Call NXT_SetInputMode function     
    62     NXT_SetInputMode(f_sensorport, sensortype, sensormode, 'dontreply');  
     75    NXT_SetInputMode(f_sensorport, sensortype, sensormode, 'dontreply', handle);  
    6376 
    6477end%function   
  • branches/atorf/RWTHMindstormsNXT/OpenSwitch.m

    r123 r303  
    1 function OpenSwitch(f_sensorport) 
     1function OpenSwitch(port, varargin) 
    22% Sets the parameter mode of the NXT switch / touch sensor 
    33% 
     
    55%   |OpenSwitch(port)| 
    66% 
     7%   |OpenSwitch(port, handle)| 
     8% 
    79% Description 
    810%   |OpenSound(port)| initializes the input mode of NXT switch / touch sensor specified by the sensor 
    911%   |port|. The value |port| can be addressed by the symbolic constants 
    1012%   |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. 
     13% 
     14%   The last optional argument can be a valid NXT handle. If none is 
     15%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     16%   set one). 
    1117% 
    1218%   For more complex settings the function |NXT_SetInputMode| can be used. 
     
    5662 
    5763%% check parameters 
     64 
     65    % check if handle is given; if not use default one 
     66    if nargin > 1 
     67        handle = varargin{1}; 
     68    else 
     69        handle = COM_GetDefaultNXT; 
     70    end%if 
     71 
    5872    % also accept strings as input 
    59     if ischar(f_sensorport) 
    60         f_sensorport = str2double(f_sensorport); 
     73    if ischar(port) 
     74        port = str2double(port); 
    6175    end%if 
    6276 
     
    6983 
    7084%% Call NXT_SetInputMode function    
    71     NXT_SetInputMode(f_sensorport, sensortype, sensormode, 'dontreply');  
     85    NXT_SetInputMode(port, sensortype, sensormode, 'dontreply', handle);  
    7286     
    7387end%function     
  • branches/atorf/RWTHMindstormsNXT/OpenUltrasonic.m

    r296 r303  
    66% 
    77%   |OpenUltrasonic(port, mode)| 
     8% 
     9%   |OpenUltrasonic(port, mode, handle)| 
    810% 
    911% Description 
     
    1719%   |USMakeSnapshot| for more information. 
    1820% 
     21%   The last optional argument can be a valid NXT handle. If none is 
     22%   specified, the default handle will be used (call |COM_SetDefaultNXT| to 
     23%   set one). 
     24%  
    1925%   Since the NXT ultrasonic sensor is a digital sensor (that uses the I²C protocol), 
    2026%   the function |NXT_SetInputMode| cannot be used as for analog sensors. 
    2127% 
    22 %   Note: When the US sensor is opened in snapshot mode, the function 
     28% Note 
     29%   When the US sensor is opened in snapshot mode, the function 
    2330%   |GetUltrasonic| does not work correctly! 
    2431% 
     
    6471 
    6572%% Parameter check 
     73 
     74    % check if handle is given; if not use default one 
     75    if nargin > 2 
     76        handle = varargin{2}; 
     77    else 
     78        handle = COM_GetDefaultNXT; 
     79    end%if 
     80 
    6681    % also accept strings as input 
    6782    if ischar(port) 
     
    7893     
    7994     
    80     NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply'); 
     95    NXT_SetInputMode(port, 'LOWSPEED_9V', 'RAWMODE', 'dontreply', handle); 
    8196 
    8297 
     
    94109        I2Cdata(3) = hex2dec('01'); % SINGLE_SHOT 
    95110         
    96         NXT_LSWrite(port, RequestLen, I2Cdata, 'dontreply'); 
     111        NXT_LSWrite(port, RequestLen, I2Cdata, 'dontreply', handle); 
    97112         
    98113    else 
     
    104119        I2Cdata(3) = hex2dec('02'); % CONTINUOUS_MEASUREMENT 
    105120         
    106         NXT_LSWrite(port, RequestLen, I2Cdata, 'dontreply'); 
     121        NXT_LSWrite(port, RequestLen, I2Cdata, 'dontreply', handle); 
    107122    end%if 
    108123     
     
    114129    % the following command sequence is not clearly documented but was 
    115130    % found to work well! 
    116         NXT_LSGetStatus(port); % flush out data with Poll 
     131        NXT_LSGetStatus(port, handle); % flush out data with Poll 
    117132    % we request the status-byte so that it doesn't get checked. 
    118133    % errors that can occur here are: 
     
    120135    %Packet (reply to LSREAD) contains error message 224: "Specified 
    121136    %channel/connection not configured or busy" 
    122         [a b c] = NXT_LSRead(port);      % flush out data with Poll? 
     137        [a b c] = NXT_LSRead(port, handle);      % flush out data with Poll? 
    123138 
    124139end%function