Code covered by the BSD License  

Highlights from
Jasco BPR RS232 communication

Jasco BPR RS232 communication

by

 

20 May 2013 (Updated )

Drivers and higher level commands for controlling Jasco BPRs via RS232.

bprobjreadsettemp.m
function setTemp = bprobjreadsettemp(serialObject)
% BPROBJREADSETTEMP reads the set temperature of Jasco BPRs
% setTemp = bprobjreadsettemp(serialObject) reads the current set
% temperature of Jasco BPRs.  serialObject is the BPR serial object
% (generated by bprobj). The temperature is returned as a scalar in C.

% e.g. bprobjreadsettemp(serialObject) - returns the current set temperature
% of the BPR e.g. 50 (C)

% Range:

% serialObject = valid serial port object


% checks the number of arguments
error(nargchk(1, 1, nargin))
    
% requests set temperature
setTemp = bprobjcomm(serialObject, '#0x1000 0x85');

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

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

Contact us