from
Jasco Pumps RS232 communicatios
by Geoffrey Akien
Commands to read and control Jasco pumps via RS232.
|
| pumpobjconnect(serialObject)
|
function pumpobjconnect(serialObject)
% PUMPOBJCONNECT initialises communication with Jasco pumps
% pumpobjconnect(serialObject) initialises communication with Jasco pumps,
% given serialObject as a valid pump serial object (generated by pumpobj).
% e.g. pumpobjconnect(serialObject) - initialises communication with the
% pump attached to COM9.
% 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 (MLint wrongly reports this as outputting something)
fopen(serialObject)
% Vista needs a brief pause to behave itself correctly - I've left his is
% for XP too, but in case you wanted to shave off that whole 400 ms, you
% could try...BUT old MATLAB versions detect Vista as "Microsoft Windows
% 2000" - whether this is required or not for realterm has not been tested
%if isempty(strfind(system_dependent('getos'), 'XP'))
pause(0.4)
%end
|
|
Contact us