Code covered by the BSD License  

Highlights from
Knauer pump RS232 communication

Knauer pump RS232 communication



Functions for communicating with Knauer pumps via RS232.

knauerpumpobjwritestartlevel(serialObject, startLevel)
function knauerpumpobjwritestartlevel(serialObject, startLevel)
% KNAUERPUMPOBJWRITESTARTLEVEL changes the start level for Knauer pumps
% knauerpumpobjwritestartlevel(serialObject, startLevel) writes the start
% level for Knauer pumps, where serialObject is a valid serial object
% generated by knauerpumpobj.  0 is low/off and 1 is high.

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

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

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

Contact us