Code covered by the BSD License  

Highlights from
CO2gui - lab control and automation

CO2gui - lab control and automation



06 Jan 2010 (Updated )

Software used for controlling and data logging lab equipment.

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
    % 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);

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

    % gets the status
    %data{6} = gilsonpumpobjstatus(gilsonPumpObj);

% 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