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.

rheodyne232objwritebaudrate(serialObject, baudRate)
function rheodyne232objwritebaudrate(serialObject, baudRate)
% RHEODYNE232OBJWRITEBAUDRATE changes the baud rate (reset required)
% rheodyne232objwritebaudrate(serialObject, baudRate) changes the baud rate
% of the valve (largely pointless since so the commands are so small).  The
% baud rate can be: 9600, 19200, 38400 or 57600.

% defines the baud rates
baud = [9600, 19200, 38400, 57600];

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

% checks the baud rate supplied
if ~isnumeric(baud) || ~isscalar(baud) || ~ismember(baudRate, baud)
    % errors
    error('Invalid baud rate.')
end

% sends the command (looked up from the list)
rheodyne232objcomm(serialObject, ['X', dec2hex(find(baud == baudRate))]);

Contact us