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.

bprobjwritemaxtemp.m
function bprobjwritemaxtemp(BPRObj, maxTemp)
% BPROBJWRITEMAXTEMP sets the maximum temperature of Jasco BPRs
% bprobjwritemaxtemp(BPRObj, maxTemp) sets the maximum
% valve temperature on Jasco back-pressure regulators, where BPRObj is a
% valid serial port object (generated by bprobj) and maxTemp is the
% temperature in C (number from 30-90).

% e.g. bprobjwritemaxtemp(BPRObj(5), 90) - sets the maximum temperature of
% the BPR on COM5 to 90 (C).

% Range:

% BPRObj = valid serial port object

% maxTemp = unsigned number: 30-90


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

% error handling
if ~isnumberbetween(maxTemp, 30, 90)
    % errors
    error('Maximum temperature must be a number from 30 to 90 C')
end

% rounds and converts it (warns if it rounds it)
maxTemp = roundto(maxTemp * 100, 0, true);

% need to convert number into a hexadecimal string for the bprobjcomm
% command - sends command
bprobjcomm(BPRObj, ['#0x43 ', dec2hex(maxTemp)])

Contact us