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.

gilsonpumpobjreadpresssetup(gilsonPumpObj)
function [minPress, maxPress] = gilsonpumpobjreadpresssetup(gilsonPumpObj)
% GILSONPUMPOBJREADPRESSSETUP reads the pressures of Gilson 30x pumps
% [minPress, maxPress] = gilsonpumpobjreadpresssetup(gilsonPumpObj) returns
% the maximum and minimum pressures of Gilson 30x pumps, where
% gilsonPumpObj is a valid serial object generated by gilsonPumpObj.
% Response is in bar.  The function will error if no manometric module is
% installed as these options are not accessible otherwise.

% 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 maximum and minimum pressures.')
end

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

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

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

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

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

% extract out the numeric part
maxPress = str2double(topLine1(isstrprop(topLine1, 'digit')));

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

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

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

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

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

Contact us