Code covered by the BSD License  

Highlights from
Knauer pump RS232 communication

Knauer pump RS232 communication

by

Geoffrey Akien

 

Functions for communicating with Knauer pumps via RS232.

knauerpumpobjwriteerrorio(serialObject, errorIO)
function knauerpumpobjwriteerrorio(serialObject, errorIO)
% KNAUERPUMPOBJWRITESTARTMODE changes the error I/O mode of Knauer pumps
% knauerpumpobjwriteerrorio(serialObject, errorIO) writes the error I/O
% mode for Knauer pumps, where serialObject is a valid serial object
% generated by knauerpumpobj.  0 is OUT and 1 is IN - but it is not clear
% what this actually does.

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

% checks the start mode is valid or not
if ~isequal(errorIO, 0) && ~isequal(errorIO, 1)
    
    % complain
    error('Must supply a valid error I/O mode - 0 or 1.')
end

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

Contact us