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.

bprobjreaddisplayunits(BPRObj)
function displayUnits = bprobjreaddisplayunits(BPRObj)
% BPROBJREADDISPLAYUNITS reads the display units of Jasco BPRs
% bprobjreaddisplayunits(BPRObj, status) returns the display units of Jasco
% back-pressure regulators, where BPRObj is a valid serial port object
% (generated by bprobj) and displayUnits is 0 (MPa), 1 (bar), or 2
% (kg/cm^2).

% e.g. bprobjreaddisplayunits(BPRObj(5)) - reutnrs the display units of
% the BPR on COM5, e.g. bar is 1.

% Range:

% BPRObj = valid serial port object

% displayUnits = 0, 1 or 2


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

% requests display units
displayUnits = bprobjcomm(BPRObj, '#0x1000 0x89');

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

% selects out the display units and converts it into a number
displayUnits = str2double(displayUnits{1}{3});

Contact us