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.

bprobjreaddisplayunits(serialObject)
function displayUnits = bprobjreaddisplayunits(serialObject)
% BPROBJREADDISPLAYUNITS reads the display units of Jasco BPRs
% bprobjreaddisplayunits(serialObject, status) returns the display units of
% Jasco back-pressure regulators, where serialObject is a valid serial port
% object (generated by bprobj) and displayUnits is 0 (MPa), 1 (bar), or 2
% (kg/cm^2).

% e.g. bprobjreaddisplayunits(serialObject) - reutnrs the display units of
% the BPR, e.g. bar is 1.

% Range:

% serialObject = valid serial port object

% displayUnits = 0, 1 or 2


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

% requests display units
displayUnits = bprobjcomm(serialObject, '#0x1000 0x89');

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

% selects out the display units and converts it into a number
displayUnits = str2double(displayUnits{1}{3});

Contact us