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.

gilsonpumpobjreadallmanometric(gilsonPumpObj)
function data = gilsonpumpobjreadallmanometric(gilsonPumpObj)
% GILSONPUMPOBJREADALLMANOMETRIC returns currenmt data from Gilson 30x pump
% data = gilsonpumpobjreadallmanometric(gilsonPumpObj) returns a cell
% array, with the current pressure as the 3rd element, and the flow rate as
% the final (5th) element.

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

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

% try-catches to prevent errors
try
    % checks the manometric module is installed for speed
    if isfield(gilsonPumpObj.UserData, 'manometricModule') && ~strcmp(gilsonPympObj.UserData.manometricModule, 'None')
        % gets the current pressure - will error if no manometric module is
        % installed
        data{3} = gilsonpumpobjcurrentpress(gilsonPumpObj);
    end
catch
end

% try-catches to get data out without breaking
try
    % gets flow rate (don't need to simplify this at all since there is
    % only one thing to read out
    data{5} = gilsonpumpobjreadflow(gilsonPumpObj);
catch
end

%try
    % gets the status
    %data{6} = gilsonpumpobjstatus(gilsonPumpObj);
%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