Code covered by the BSD License  

Highlights from
GSIOC RS232 communication files

GSIOC RS232 communication files

by

 

For communicating with GSIOC devices via RS232

gsiocobjconnect(serialObject)
function gsiocobjconnect(serialObject)
% GSIOCOBJCONNECT initialises communication with GSIOC devices
% gsiocobjconnect(serialObject) initialises communication with GSIOC
% devices, given serialObject as a valid serial object (generated by
% gsiocobj).

% e.g. gsiocobjconnect(serialObject) - initialises communication
% with the GSIOC device

% Range:

% serialObject = valid serial port object


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

% error handling
if ~isa(serialObject, 'serial') || ~isvalid(serialObject) || ~strcmp(serialObject.Status, 'closed')
    % errors
    error('serialObject must be a valid closed serial object.')
end

% opens communication
fopen(serialObject)

Contact us