Code covered by the BSD License  

Highlights from
Knauer pump RS232 communication

Knauer pump RS232 communication



Functions for communicating with Knauer pumps via RS232.

function pumpHeadSize = knauerpumpobjreadpumpheadsizefast(serialObject)
% KNAUERPUMPOBJREADPUMPHEADSIZE reads the pump head size of Knauer pumps
% pumpHeadSize = knauerpumpobjreadpumpheadsize(serialObject) returns the
% pump head size of Knauer pumps, where serialObject is a valid serial
% object generated by knauerpumpobj.  Response is in mL.  This command
% differs from the normal version in that it will attempt to retrieve the
% pumpHeadSize from the serialObject UserData first, so is more useful for
% routine use since it reduces the communications overhead.

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

% need to know the pump head size to figure out which command to use - the
% isfield statement also checks for isstruct at the same time
if isfield(serialObject.UserData, 'pumpHeadSize')
    % use that
    pumpHeadSize = serialObject.UserData.pumpHeadSize;
    % we need to ask it first, but don't assume we can save it to the
    % UserData
    pumpHeadSize = knauerpumpobjreadpumpheadsize(serialObject);

Contact us