Code covered by the BSD License  

Highlights from
Knauer pump RS232 communication

Knauer pump RS232 communication

by

 

Functions for communicating with Knauer pumps via RS232.

knauerpumpobjreadadjustparameter(serialObject, pumpHeadSize)
function adjustParameter = knauerpumpobjreadadjustparameter(serialObject, pumpHeadSize)
% KNAUERPUMPOBJREADADJUSTPARAMETER returns the adjust parameter for Knauer pumps
% adjustParameter = knauerpumpobjreadadjustparameter(serialObject,
% pumpHeadSize) returns the adjust parameter of Knauer pumps connected to a
% valid serial object, as numbers.  If no pump head size is supplied, it
% will try and retrieve it, but if one is supplied, then will retrieve the
% adjust parameter 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
    pumpHeadSize = knauerpumpobjreadpumpheadsizefast(serialObject);
end

% forms and writes command, adding the pump head size to the command
% because there are different values for this
adjustParameter = knauerpumpobjcomm(serialObject, 'read', sprintf('ADJ%d?', pumpHeadSize));

Contact us