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.

gilsonpumpobjreadmaxpossiblepress(gilsonPumpObj, manometricModule, pumpHeadSize)
function [maxPossiblePress, manometricModule, pumpHeadSize] = gilsonpumpobjreadmaxpossiblepress(gilsonPumpObj, manometricModule, pumpHeadSize)
% GILSONPUMPOBJREADMAXPOSSIBLEPRESS reads the max. press. of Gilson 30x's
% [maxPossiblePress, manometricModule, pumpHeadSize] =
% gilsonpumpobjreadmaxpossiblepress(gilsonPumpObj) returns the maximum
% allowable pressure of Gilson 30x pumps, as determined by the connected
% manometric module (if attached), and the pump head, where gilsonPumpObj
% is a valid serial object generated by gilsonPumpObj. Response is in bar.
% If additional output arguments are supplied, it also retursn the
% manometric module and the pump head size.  If the manometric module
% and/or the pump head size are supplied, then these values are used, and
% new ones are not retrieved (faster if for another reason you already have
% these values to hand).  If the manometricModule or pumpHeadSize are
% empty, they are ignored.


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

% gets the manometric module if one is not supplied, or if the supplied one
% is not valid
if nargin < 2 || (nargin >= 2 && isempty(manometricModule)) || all(~strcmp(manometricModule, {'None', 'M805', 'M806', 'M807'}))
    % gets the manometricModule identity
    manometricModule = gilsonpumpobjreadmanometricmodule(gilsonPumpObj);
end

% determines the maximum allowable pressure based on the manometric module
switch manometricModule
    case {'None', 'M805'}
        % determined by maximum pressure rating of pump
        maxManoPress = 600;
        
    case 'M806'
        % lower pressure again
        maxManoPress = 320;
        
    case 'M807'
        % lower pressure again
        maxManoPress = 80;
        
    otherwise
        % assumes the pump determines the maximum pressure
        maxManoPress = 600;
end

% gets the pump head size if one is not supplied, or if supplied value is
% invalid
if nargin < 3 || (nargin >= 3 && isempty(pumpHeadSize)) || all(~ismember([5, 10, 25, 50, 100, 200], pumpHeadSize))
    % gets the pump head size
    pumpHeadSize = gilsonpumpobjreadpumpheadsize(gilsonPumpObj);
end

% determines the maximum allowable pressure based on the pump head size
switch pumpHeadSize
    case {5, 10}
        % determined by maximum pressure rating of pump
        maxPumpHeadPress = 600;
        
    case 25
        % lower pressure again
        maxPumpHeadPress = 280;
        
    case 50
        % lower pressure again
        maxPumpHeadPress = 140;
        
    case 100
        % lower pressure again
        maxPumpHeadPress = 70;
        
    case 200
        % lower pressure again
        maxPumpHeadPress = 35;
        
    otherwise
        % assumes the pump determines the maximum pressure
        maxPumpHeadPress = 600;
end

% finds the minimum maximum possible pressure
maxPossiblePress = min([maxManoPress, maxPumpHeadPress]);

Contact us