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 valveSpeed = bprobjreadvalvespeed(serialObject)
% BPROBJREADVALVESPEED reads the valve speed of Jasco BPRs
% valveSpeed = bprobjreadvalvespeed(serialObject) reads the current valve
% speed of Jasco BPRs.  serialObject is the BPR serial object (generated by
% bprobj). The valve speed is returned as 0 (slow) or 1 (quick).

% e.g. bprobjreadvalvespeed(serialObject) - returns the current
% valve speed of the BPR e.g. 1.

% Range:

% serialObject = valid serial port object

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

% requests valve speed
valveSpeed = bprobjcomm(serialObject, '#0x1000 0x81');

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

% selects out the status and converts it into a number
valveSpeed = logical(str2double(valveSpeed{1}{3}));

Contact us