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.

pumpobjreadflow(pumpObj)
function currentFlow = pumpobjreadflow(pumpObj)
% PUMPOBJREADFLOW returns the current flow rate of Jasco pumps
% currentFlow = pumpobjreadflow(pumpObj) 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', pumpObj, '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