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.

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

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

% Range:

% serialObject = valid serial port object

% maxTemp = unsigned number: 30-90


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

% error handling
if ~isscalar(maxTemp) || ~isnumeric(maxTemp) || maxTemp < 30 || maxTemp > 90
    % errors
    error('Maximum temperature must be a number from 30 to 90 C')
end

% rounds and converts it to the correct scale (strange units on BPR)
maxTemp = round(maxTemp * 100);

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

Contact us