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.

fibreobjstart(serialObject)
function fibreobjstart(serialObject)
% FIBREOBJSTART starts data transmission from the FOR
% fibreobjstart(serialObject) starts data transmission from the FOR.  If
% its already transmitting, this function will not send the command, but
% will not error either.


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

% tries to get some data first to see if it is transmitting
try
    % tries to fetch the data - it'll error if it isn't broadcasting
    fibreobjreadintensity(serialObject);

    % it didn't error, so simply give a warning
    warning('fibreObjBroadcast:alreadyRunning', 'FOR is already broadcasting.')

catch
    % starts the broadcast
    try
        % sends the command
        fibreobjcomm('write', serialObject, 2, 1, 0)

    catch
        % errors
        error('FOR did not accept the command to start broadcasting data.')
    end
end

Contact us