Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation



06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

pumpobjwriteminpress(pumpObj, minPress)
function pumpobjwriteminpress(pumpObj, minPress)
% PUMPOBJWRITEMINPRESS sets minimum pressure of Jasco pumps
% pumpobjwriteminpress(pumpObj, 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(pumpObj(9), 250) - sets minimum pressure of the
% pump on COM9 to 250 bar

% Range:

% pumpObj = valid serial port object

% minPress = unsigned number: 0-350

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

% error handling
if ~isnumberbetween(minPress, 0, 350)
    % errors
    error('Maximum pressure must be a number from 0 to 350 bar')

% 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.')

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

Contact us