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.

bprobjwritevalvespeed(serialObject, valveSpeed)
function bprobjwritevalvespeed(serialObject, valveSpeed)
% BPROBJWRITEVALVESPEED sets the valve speed of Jasco BPRs
% bprobjwritevalvespeed(serialObject, valveSpeed) sets the valve speed of
% Jasco back-pressure regulators, where serialObject is a valid serial port
% object (generated by bprobj) and status is 0 (slow) or 1 (quick).

% e.g. bprobjwritevalvespeed(serialObject, 1) - sets the valve speed to 1
% (quick).

% Range:

% serialObject = valid serial port object

% valveSpeed = 0 or 1


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

% error handling
if ~isnumeric(valveSpeed) || ~isscalar(valveSpeed) || ~ismember(valveSpeed, 0:1)
    % errors
    error('Valve speed must be a logical number (0 or 1)')
end

% sends command
bprobjcomm(serialObject, sprintf('#0x41 %d', valveSpeed))

Contact us