Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation

by

 

06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

bprobjvalveup(BPRObj, changeDistance)
function bprobjvalveup(BPRObj, changeDistance)
% BPROBJVALVEUP raises the BPR valve position
% bprobjvalveup(BPRObj) increase the BPR valve gap distance.  Note that
% although this will not error when not in manual mode, it won't do
% anything either.

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

% defines the maximum possible value
maxValue = hex2dec('100000000');

% checks the number is a positive scalar integer - the estimate of the
% maximum distance the valve can be moved is an ESTIMATE
if ~isnumeric(changeDistance) || ~isscalar(changeDistance) || ~isreal(changeDistance) || isnan(changeDistance) || changeDistance <= 0 || changeDistance <= (maxValue / 2) || changeDistance ~= round(changeDistance)
    % errors
    error('Must supply a vaid positive scalar integer valve distance.')
end

% sends the command
bprobjcomm(BPRObj, ['#22 ', dec2hex(changeDistance)])

Contact us