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.

gilsonpumpobjreadminpress(gilsonPumpObj)
function minPress = gilsonpumpobjreadminpress(gilsonPumpObj)
% GILSONPUMPOBJREADMINPRESS reads the min. pressure of Gilson 30x pumps
% minPress = gilsonpumpobjreadminpress(gilsonPumpObj) returns the
% minimum pressure of Gilson 30x pumps, where gilsonPumpObj is a valid
% serial object generated by gilsonPumpObj.  Response 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')
    % errors
    error('No manometric module installed so cannot read minimum pressure.')
end

% no easy way of reading minimum pressure, so need to navigate into the
% correct menu
gilsonpumpobjmainmenu(gilsonPumpObj);

% goes to the low pressure limit screen
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, 'Kba');

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

% chops off the 'W0=' part at the beginning
topLine = topLine(4:end);

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

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

Contact us