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.

fibreobjreaddelaytime(serialObject)
function delayTime = fibreobjreaddelaytime(serialObject)
% FIBREOBJREADDELAYTIME reads the time between broadcasts from the FOR
% delayTime = fibreobjreaddelaytime(serialObject) reads the time between
% each broadcast from the FOR in ms.


% 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 delay time.')
end

% sends it, along with the calculated checksum
try
    % sends the command (note that the delay time is actually double what
    % gets written to the device
    delayTime = fibreobjcomm('read', serialObject, 10, 2) * 2;
    
    % if it got this far, store it
    serialObject.UserData.delayTime = delayTime;
    
catch
    % errors
    error('Could not read the delay time.')
end

Contact us