Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation

by

 

06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

pumpobjwriteflowmode(pumpObj, flowMode)
function pumpobjwriteflowmode(pumpObj, flowMode)
% PUMPOBJWRITEFLOWMODE sets the flow mode of Jasco pumps
% pumpobjwriteflowmode(pumpObj, mode) changes the flow mode of Jasco pumps
% to constant flow (mode == 0) or constant pressure (mode == 1), given a
% valid serial object and a mode number.

% e.g. pumpobjwriteflowmode(pumpObj(9), 0) - sets flow mode to constant
% flow for the pump attached to COM9

% Range:

% pumpObj = valid serial port object

% flowMode = 0 or 1


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

% error handling
if ~isequal(flowMode, 0) && ~isequal(flowMode, 1)
    % errors
    error('Flow mode must be 0 (constant flow) or 1 (constant pressure).')
end

% forms and writes command
pumpobjcomm('write', pumpObj, sprintf('%d cfcp set', flowMode))

Contact us