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.

tempobjreadall(tempObj)
function data = tempobjreadall(tempObj)
% TEMPOBJREADALL returns the current data of Eurotherm controllers
% data = tempobjreadall(tempObj) returns a cell array, with the current 
% temperature, the set temperature, and the rest as empty elements.


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

% pre-allocates the answer
data = cell(1, 6);

% try-catches to get data out without breaking
try
    % gets current temperature and set temperature
    data(1:2) = num2cell(tempobjcomm('readfullres', tempObj, 1, 1, 2));
    
    % if the current temperature says 1372 - its lying - its a sensor break
    % - set it to NaN
    if data{1} == 1372
        % change it
        data{1} = NaN;
    end
catch
end

% tries to get the current status
try
    % gets the current status
    data{6} = tempobjstatus(tempObj);
catch
end

Contact us