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.

knauerpumpobjreadmaxflow(serialObject, pumpHeadSize)
function maxFlow = knauerpumpobjreadmaxflow(serialObject, pumpHeadSize)
% KNAUERPUMPOBJREADMAXFLOW returns the maximum flow rate of Knauer pumps
% maxFlow = knauerpumpobjreadmaxflow(serialObject, pumpHeadSize) returns
% the maximum flow rate of Knauer pumps connected to a valid serial object,
% as numbers.  If no pump head size is supplied, it will try and retrieve
% it from either the UserData, or by requesting it from the pump directly,
% but if one is supplied, then will retrieve the maximum flow rate set for
% that pump head size.

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

% if a pump head size was supplied...
if nargin >= 2
    
    % check the input
    if ~isvalidknauerpumpheadsize(pumpHeadSize)
        
        % complain
        error('Must supply a valid pump head size - 10 or 50 [mL].')
    end

else
    
    % fetch it (attempts to fetch it from the UserData, and if not, the
    % pump itself)
    pumpHeadSize = knauerpumpobjreadpumpheadsizefast(serialObject);
end

% the maximum flow rate is simply the size of the pump head (so far)
maxFlow = pumpHeadSize;

Contact us