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.

tc08disconnect(tc08Handle)
function tc08disconnect(tc08Handle)
% TC08DISCONNECT terminates communication with PicoLog program
% tc08disconnect(tc08Handle) terminates communication with the PicoLog
% program with the handle given by tc08connect previously.

% e.g. tc08disconnect(tc08connect) connects then disconnects again
% (pointless example)

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

% error handling
if ~isnumeric(tc08Handle) || ~isscalar(tc08Handle) || ~isreal(tc08Handle) || isnan(tc08Handle) || ~tc08Handle
    % errors
    error('Handle must be a real scalar number not equal to 0 obtained from tc08connect')
end

% terminates communications
response = ddeterm(tc08Handle);

% if it didn't work...
if ~response
    % errors
    error('Did not disconnect from TC-08 properly.')
end

Contact us