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 pumpHeadSize = gilsonpumpobjreadpumpheadsize(gilsonPumpObj)
% GILSONPUMPOBJREADPUMPHEADSIZE reads the pump head size of Gilson 30x pump
% pumpHeadSize = gilsonpumpobjreadpumpheadsize(gilsonPumpObj) returns the
% pump head size of Gilson 30x pumps, where gilsonPumpObj is a valid
% serial object generated by gilsonPumpObj.  Response is in mL.

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

% deviceID
deviceID = 1;

% checks if a manometric module is installed, since this determines if the
% compressibility item appears in the menu or not, so it needs an extra key
% press to get to it
if strcmp(gilsonpumpobjcomm('read', gilsonPumpObj, deviceID, 'L'), 'None')
    % sets it to empty
   keyStroke = '';
    % have to navigate to the next menu
   keyStroke = 'a';

% navigates to the main menu

% then navigates to the pump options menu: pump > A > Pump refill time >
% Pump compressibility (if manometric module present) > Pump head size
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, ['Kaaa', keyStroke]);

% makes sure the next display line to read is the first line
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, 'W0');

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

% extracts the pump head size out
pumpHeadSize = str2double(topLine(isstrprop(topLine, 'digit')));

% saves it to the user data
gilsonPumpObj.UserData = catstructs(gilsonPumpObj.UserData, struct('pumpHeadSize', pumpHeadSize));

% returns the menu back to the correct position
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, 'Ke');

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

Contact us