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 setPress = bprobjreadsetpress(BPRObj)
% BPROBJREADSETPRESS reads the set pressure of Jasco BPRs
% setPress = bprobjreadsetpress(BPRObj) reads the current set pressure of
% Jasco BPRs. BPRObj is the BPR serial object (generated by bproj). The
% pressure is returned in bar.

% e.g. bprobjreadsetpress(bprobj(5)) - returns the current set pressure of
% the BPR on COM5 e.g. 100 (bar)

% Range:

% BPRObj = valid serial port object

% checks the number of arguments
error(nargchk(1, 1, nargin))
% requests set pressure
setPress = bprobjcomm(BPRObj, '#0x1000 0x84');

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

% selects out the pressure and converts it into bar
setPress = hex2dec(setPress{1}{3}) / 10;

Contact us