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.

bprobjcurrenttemp.m
function currentTemp = bprobjcurrenttemp(BPRObj)
% BPROBJCURRENTTEMP reads the current temperature of Jasco BPRs
% currentTemp = bprobjcurrenttemp(BPRObj) reads the current temperature of
% Jasco BPRs. BPRObj is the BPR serial object (generated by bprobj). The
% temperature is returned as a double precision scalar number in C.

% e.g. bprobjcurrenttemp(bprobj(5)) - returns the current temperature of
% the BPR on COM5 e.g. 49.6 (C)

% Range:

% BPRObj = valid serial port object


% checks the number of arguments
error(nargchk(1, 1, nargin))
    
% gets set temperature (also set pressure, but ignored here)
% sends command (returns both pressure and temperature)
currentTemp = bprobjcomm(BPRObj, '#0x1000 0x12');

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

% selects out the temperature and converts into C
currentTemp = hex2dec(currentTemp{1}{4}) / 100;

Contact us