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.

bprobjwritedisplayunits(BPRObj, displayUnits)
function bprobjwritedisplayunits(BPRObj, displayUnits)
% BPROBJWRITEDISPLAYUNITS sets the display units of Jasco BPRs
% bprobjwritedisplayunits(BPRObj, status) sets 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. bprobjwritedisplayunits(BPRObj(5), 1) - sets the display units of
% the BPR on COM5 to bar.

% Range:

% BPRObj = valid serial port object

% displayUnits = 0, 1 or 2


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

% error handling
if ~isnumeric(displayUnits) || ~isscalar(displayUnits) || ~ismember(displayUnits, 0:2)
    % errors
    error('Display units must be 0 (MPa), 1 (bar), or 2 (kg/cm^2).')
end

% sends command
bprobjcomm(BPRObj, sprintf('#0x46 %d', displayUnits))

Contact us