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 setPress = bprobjreadsetpress(serialObject)
% BPROBJREADSETPRESS reads the set pressure of Jasco BPRs
% setPress = bprobjreadsetpress(serialObject) reads the current set
% pressure of Jasco BPRs. serialObject is the BPR serial object (generated
% by bprobj). The pressure is returned in bar.

% e.g. bprobjreadsetpress(serialObject) - returns the current set pressure of
% the BPR e.g. 100 (bar)

% Range:

% serialObject = valid serial port object

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

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

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

Contact us