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.

fibreobjreadaverages(serialObject)
function averages = fibreobjreadaverages(serialObject)
% FIBREOBJREADAVERAGES reads the number of averages from the FOR
% averages = fibreobjwriteaverages(serialObject) reads the averages from
% the FOR.


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

% checks its not broadcasting
if fibreobjstatus(serialObject)
    % error
    error('FOR must not be broadcasting to read the number of averages.')
end

% reads the parameter
try
    % sends and converts it
    averages = fibreobjcomm('read', serialObject, 0, 2);
    
    % if it got this far, then store it in user data
    serialObject.UserData.averages = averages;

catch
    % errors
    error('Could not read the number of averages.')
end

Contact us