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.

gilsonpumpobjwriterefilltime(gilsonPumpObj, refillTime)
function gilsonpumpobjwriterefilltime(gilsonPumpObj, refillTime)
% GILSONPUMPOBJWRITEREFILLTIME writes the refill time of Gilson 30x pumps
% gilsonpumpobjwriterefilltime(gilsonPumpObj, refillTime) writes the
% refillTime of Gilson 30x pumps, where gilsonPumpObj is a valid
% serial object generated by gilsonPumpObj.  refillTime is in ms.  If you
% insist on giving it a non-integer refill time, it will be rounded off.

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

% deviceID
deviceID = 1;

% error handling of refill time
if ~isnumberbetween(refillTime, 125, 1000)
    % errors
    error('Refill time must be an integer from 125 to 1000 (ms).')

% the "official" way of doing things would be (if it worked)
%gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, ['R', num2str(refillTime)]);

% rounds the refill time (also warns if it was rounded)
refillTime = roundto(refillTime, 0, true);

% no easy way of writing refill time, so need to navigate into the correct
% menu

% navigates to refill time menu, then enters the new time in, then
% navigates back to the pump menu
gilsonpumpobjcomm('write', gilsonPumpObj, deviceID, ['Kaa', num2str(round(refillTime)), 'Ee']);

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

Contact us