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.

bprobjwritedisplayunits(serialObject, displayUnits)
function bprobjwritedisplayunits(serialObject, displayUnits)
% BPROBJWRITEDISPLAYUNITS sets the display units of Jasco BPRs
% bprobjwritedisplayunits(serialObject, status) sets 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. bprobjwritedisplayunits(serialObject, 1) - sets the display units of
% the BPR to bar.

% Range:

% serialObject = valid serial port object

% displayUnits = 0, 1 or 2


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

% error handling
if ~isnumeric(displayUnits) || ~isscalar(displayUnits) || ~ismember(displayUnits, 0:2)
    % errors
    error('Display units must be 0 (MPa), 1 (bar), or 2 (kg/cm^2).')
end

% sends command
bprobjcomm(serialObject, sprintf('#0x46 %d', displayUnits))

Contact us