Code covered by the BSD License  

Highlights from
Knauer pump RS232 communication

Knauer pump RS232 communication

by

 

Functions for communicating with Knauer pumps via RS232.

knauerpumpobjwriteexternalcontrol(serialObject, externalControl)
function knauerpumpobjwriteexternalcontrol(serialObject, externalControl)
% KNAUERPUMPOBJWRITESTARTMODE changes the external flow control mode for Knauer pumps
% knauerpumpobjwriteexternalcontrol(serialObject, externalControl) changes
% the external control mode for Knauer pumps.  1 turns it on, which will
% then prevent any flow control by any other means (i.e. keypad or
% 'FLOW:x').  0 turns it off.

% checks the number of arguments
error(nargchk(2, 2, nargin))

% checks the start mode is valid or not
if ~isequal(externalControl, 0) && ~isequal(externalControl, 1)
    
    % complain
    error('Must supply a valid external control mode - 0 or 1.')
end

% writes it
knauerpumpobjcomm(serialObject, 'write', sprintf('EXTCONTR:%.0f', externalControl));

Contact us