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.

bprobjreadmaxtemp.m
function maxTemp = bprobjreadmaxtemp(serialObject)
% BPROBJREADMAXTEMP reads the maximum temperature of Jasco BPRs
% maxTemp = bprobjreadmaxtemp(serialObject) reads the current maximum
% temperature of Jasco BPRs.  serialObject is the BPR serial object
% (generated by bprobj). The temperature is returned as a scalar in C.

% e.g. bprobjreadmaxtemp(serialObject) - returns the current maximum
% temperature of the BPR e.g. 90 (C)

% Range:

% serialObject = valid serial port object


% checks the number of arguments
error(nargchk(1, 1, nargin))
    
% requests maximum temperature
maxTemp = bprobjcomm(serialObject, '#0x1000 0x83');

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

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

Contact us