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.

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

% e.g. bprobjwritesettemp(BPRObj(5), 50) - sets the temperature of the BPR on
% COM5 to 50 (C).

% Range:

% BPRObj = valid serial port object

% setTemp = unsigned number: 30-90


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

% error handling
if ~isnumberbetween(setTemp, 30, 80)
    % errors
    error('Temperature must be a number from 30 to 80 C')
end

% coverts and rounds the temperature off (warns if it did)
setTemp = roundto(setTemp * 100, 0, true);

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

Contact us