Code covered by the BSD License  

Highlights from
Jasco Pumps RS232 communicatios

Jasco Pumps RS232 communicatios

by

 

20 May 2013 (Updated )

Commands to read and control Jasco pumps via RS232.

pumpobjwriteminpress(serialObject, minPress)
function pumpobjwriteminpress(serialObject, minPress)
% PUMPOBJWRITEMINPRESS sets minimum pressure of Jasco pumps
% pumpobjwriteminpress(serialObject, minPress) changes the minimum pressure
% of Jasco pumps (where the pump will stop pumping automatically) given a
% valid serial object and a pressure from 0 to 350 bar.  The function
% automatically rounds the minimum pressure to the nearest integer.

% e.g. pumpobjwriteminpress(serialObject, 250) - sets minimum pressure of
% the pump to 250 bar

% Range:

% serialObject = valid serial port object

% minPress = unsigned number: 0-350


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

% error handling
if ~isscalar(minPress) || ~isnumeric(minPress) || minPress < 0 || minPress > 350
    % errors
    error('Maximum pressure must be a number from 0 to 350 bar')
end

% checks the minimum pressure
if minPress ~= round(minPress)
    % display a warning (don't actually need to round it off as the sprintf
    % will deal with that)
    warning('JascoPumpWriteMinPress:ValueTooPrecise', 'Supplied minimum pressure was not an integer so has been rounded off.')
end

% forms and writes command
pumpobjcomm('write', serialObject, sprintf('%.0f pmin set', minPress))

Contact us