Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation



06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

rheodyne232objwritevalvepositionfast(serialObject, valvePosition)
function rheodyne232objwritevalvepositionfast(serialObject, valvePosition)
% rheodyne232objwritevalvepositionfast(serialObject, valvePosition) moves the
% valve to the position described.  For the usual 6-port 2-position valves
% we use, this must be either 1 or 2.  0 is also interpreted as 2 at the
% software level to allow for easier programming. The error checking will
% need to be changed to allow the use of other Rheodyne valves.  This is
% the fast version because it does not check for the response from the
% Rheodyne that the valve position has changed.

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

% checks the valve position (note that 'M' SHOULD return the valve to the
% home position but doesn't seem to change anything)
if ~isequal(valvePosition, 0) && ~isequal(valvePosition, 1) && ~isequal(valvePosition, 2) %&& ~isequal(valvePosition, 'M')
    % errors
    error('Invalid valve position.')

% converts the valve position if necessary
if ~valvePosition
    % changes it
    valvePosition = 2;

% sends the command
rheodyne232objfastcomm(serialObject, ['P0', dec2hex(valvePosition)])

Contact us