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.

fibreobjconnectsilent(serialObject)
function fibreobjconnectsilent(serialObject)
% FIBREOBJCONNECTSILENT initialises communication with the FOR
% fibreobjconnectsilent(serialObject) initialises communication with the
% FOR, given serialObject as a valid FOR serial object (generated by
% fibreobj).  It does not send ANY other communications to the object.

% e.g. fibreobjconnectsilent(fibreobj(9)) - initialises communication with
% the FOR attached to COM9.

% Range:

% serialObject = valid serial port object


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

% error handling
if ~isserial(serialObject) || isrunning(serialObject)
    % errors
    error('serialObject must be a valid closed serial object.')
    
elseif isfield(serialObject.UserData, 'realTermHandle') && isrunning(serialObject.UserData.realTermHandle)
    % errors
    error('The realterm application must not be connected.')
end

% if the real term handle is there, do a different sequence of events
if isfield(serialObject.UserData, 'realTermHandle')
    % run the real term opener
    serialObject.UserData.captureFileID = realtermfopen(serialObject.UserData.realTermHandle);

else
    % opens communication
    fopen(serialObject)
end

Contact us