Code covered by the BSD License  

Highlights from
Jasco BPR RS232 communication

Jasco BPR RS232 communication



20 May 2013 (Updated )

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

function maxPress = bprobjreadmaxpress(serialObject)
% BPROBJREADMAXPRESS reads the maximum pressure of Jasco BPRs
% maxPress = bprobjreadmaxpress(serialObject) reads the current maximum
% pressure of Jasco BPRs. serialObject is the BPR serial object (generated
% by bprobj). The pressure is returned in bar.

% e.g. bprobjreadmaxpress(serialObject) - returns the current maximum pressure
% of the BPR e.g. 300 (bar)

% Range:

% serialObject = valid serial port object

% checks the number of arguments
error(nargchk(1, 1, nargin))
% requests set pressure
maxPress = bprobjcomm(serialObject, '#0x1000 0x82');

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

% selects out the pressure and converts it into bar
maxPress = hex2dec(maxPress{1}{3}) / 10;

Contact us