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.

bprobjwritevalvespeed(BPRObj, valveSpeed)
function bprobjwritevalvespeed(BPRObj, valveSpeed)
% BPROBJWRITEVALVESPEED sets the valve speed of Jasco BPRs
% bprobjwritevalvespeed(BPRObj, status) sets the valve speed of Jasco
% back-pressure regulators, where BPRObj is a valid serial port object
% (generated by bprobj) and status is 0 (slow) or 1 (quick).

% e.g. bprobjwritevalvespeed(BPRObj(5), 1) - sets the valve speed to 1
% (quick).

% Range:

% BPRObj = valid serial port object

% valveSpeed = 0 or 1


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

% error handling
if ~isnumeric(valveSpeed) || ~isscalar(valveSpeed) || ~ismember(valveSpeed, 0:1)
    % errors
    error('Valve speed must be a logical number (0 or 1)')
end

% sends command
bprobjcomm(BPRObj, sprintf('#0x41 %d', valveSpeed))

Contact us