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.

knauerpumpobjwritestartmode(serialObject, startMode)
function knauerpumpobjwritestartmode(serialObject, startMode)
% KNAUERPUMPOBJWRITESTARTMODE changes the start mode of Knauer pumps
% knauerpumpobjwritestartmode(serialObject, startMode) writes the start
% mode of Knauer pumps, where serialObject is a valid serial object
% generated by knauerpumpobj.  0 does nothing, and 1 will make the pump
% resume pumping, if that's what it was doing when the power was lost.

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

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

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

Contact us