Code covered by the BSD License  

Highlights from
Jasco Pumps RS232 communicatios

Jasco Pumps RS232 communicatios

by

 

20 May 2013 (Updated )

Commands to read and control Jasco pumps via RS232.

pumpobjreadflow(serialObject)
function currentFlow = pumpobjreadflow(serialObject)
% PUMPOBJREADFLOW returns the current flow rate of Jasco pumps
% currentFlow = pumpobjreadflow(serialObject) returns the current flow rate
% of Jasco pumps connected to a valid serial port object, as a number
% rounded to 3 decimal places.

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

% fetches and formats the flow rate
currentFlow = roundto(str2double(pumpobjcomm('read', serialObject, 'a_flow load p')), 3);

% if the flow is larger than 10 (it sometimes does this for no reason
% whatsoever), set it to 0 - so far this phenomenon has only been observed
% when the pump was not running - if this happens at other times, change
% this to ask for the flow rate again
if currentFlow > 10
    % sets it to 0
    currentFlow = 0;
end

Contact us