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.

function valveSpeed = bprobjreadvalvespeed(BPRObj)
% BPROBJREADVALVESPEED reads the valve speed of Jasco BPRs
% valveSpeed = bprobjreadvalvespeed(BPRObj) reads the current valve speed
% of Jasco BPRs.  BPRObj is the BPR serial object (generated by bproj). The
% valve speed is returned as 0 (slow) or 1 (quick).

% e.g. bprobjreadvalvespeed(bprobj(5)) - returns the current
% valve speed of the BPR on COM5 e.g. 1.

% Range:

% BPRObj = valid serial port object

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

% requests valve speed
valveSpeed = bprobjcomm(BPRObj, '#0x1000 0x81');

% splits response into a cell array - the response should be "#0 0
% valveSpeed"
valveSpeed = textscan(valveSpeed, '%s');

% selects out the status and converts it into a number
valveSpeed = logical(str2double(valveSpeed{1}{3}));

Contact us