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 inletPress = gilsonpumpobjreadinletpress(gilsonPumpObj)
% GILSONPUMPOBJREADINLETPRESS reads the inlet pressure of Gilson 30x pump
% inletPress = gilsonpumpobjreadinletpress(gilsonPumpObj) returns the
% set inlet pressure of Gilson 30x pumps, where gilsonPumpObj is a valid
% serial object generated by gilsonPumpObj.  inletPress is in bar.

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

% deviceID
deviceID = 1;

% checks that a module is installed first
if ~strcmp(gilsonpumpobjreadmanometricmodule(gilsonPumpObj), 'None')
    % defines the extra keystrokes necessary to navigate through the extra
    % screen (compressibility) that is present if a module is installed
    keyStrokes = 'a';
    % defines it as empty
    keyStrokes = '';

% no easy way of reading maximum pressure, so need to navigate into the
% correct menu

% goes to the inlet pressure screen
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, ['Kaa', keyStrokes, 'aa']);

% makes sure the top line is read out next
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, 'W0');

% reads out the top line
topLine = gilsonpumpobjcomm('read', gilsonPumpObj, deviceID, 'W');

% removes the 'W0=' prefix
topLine = topLine(4:end);

% extract out the numeric part
inletPress = str2double(topLine(isstrprop(topLine, 'digit')));

% navigates back to the flow screen
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, 'Ke');

% reconnects the keypad
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, 'K');

Contact us