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.

bprobjstatus(serialObject)
function status = bprobjstatus(serialObject)
% BPROBJREADSTATUS reads the status of Jasco BPRs
% status = bprobjstatus(serialObject) reads the current status of Jasco
% BPRs.  serialObject is the BPR serial object (generated by bproj). The
% status is returned as 0 (fully open, fully closed, or manual) or 1
% (regulated).

% e.g. bprobjreadvalvestatus(serialObject) - returns the current valve
% status of the BPR e.g. 1 if regulated.

% Range:

% serialObject = valid serial port object


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

% requests valve status
status = bprobjreadvalvestatus(serialObject);

% if the status is 2 (auto-regulated) or 3 (manual regulation), set the
% response to 1
if status == 2 || status == 3
    % its regulated
    status = true;
    
else
    % set it to 0
    status = false;
end

Contact us