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.

rheodyne232objstop(serialObject)
function rheodyne232objstop(serialObject)
% RHEODYNE232OBJSTOP stops the timer for Rheodyne controllers
% rheodyne232objstop(serialObject) stops the timer for Rheodyne control,
% given a valid serial object containing the timer.

% e.g. rheodyne232objstop(rheodyne232obj(5)) stops the Rheodyne timer.


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

% checks the timer is there
if ~isserial(serialObject) || ~isrunning(serialObject)
    % complain
    error('Serial object is not a valid open serial object.')
    
elseif ~isfield(serialObject.UserData, 'timerObject') || ~istimer(serialObject.UserData.timerObject)
    % error
    error('Timer in user data of serial object is not present or is invalid.')
end

% stop it only if it was already running (stops annoying warnings coming
% up)
if isrunning(serialObject.UserData.timerObject)
    % stops the timer
    stop(serialObject.UserData.timerObject)
end

Contact us