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.

pumpobjreadall(pumpObj)
function data = pumpobjreadall(pumpObj)
% PUMPOBJREADALL returns the current flow rate of Jasco pumps
% data = pumpobjreadall(pumpObj) returns a cell array, with the first two
% elements being empty (there are no temperatures to return), then the
% currrent pressure, the set pressure, and the flow rate.


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

% pre-allocates the answer
data = cell(1, 6);

% try-catches everything to get as much data out as possible without
% breaking
try
    % gets the current pressure
    data{3} = pumpobjcurrentpress(pumpObj);
catch
end

try
    % fetches the set pressure
    data{4} = pumpobjreadsetpress(pumpObj);
catch
end

try
    % fetches the flow rate
    data{5} = pumpobjreadflow(pumpObj);
catch
end

% gets the status - pumping is defined by the flow not being 0 -
% quicker than hunting for the 'Stop' or 'Run' part of the screen,
% although not rigorously correct - the double 'not' is there to
% convert it into a logical and back again - LOGICAL complains when you
% give it a value that isn't a 0 or a 1. if communications failed, then
% any([]) returns a 0 - i.e. not pumping
data{6} = any(data{5});

Contact us