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.

gilsonpumpobjkeypadlockstatus(gilsonPumpObj)
function status = gilsonpumpobjkeypadlockstatus(gilsonPumpObj)
% GILSONPUMPOBJKEYPADLOCKSTATUS finds if the keypad is locked Gilson 30x's
% status = gilsonpumpobjkeypadlockstatus(gilsonPumpObj) finds the keypad
% lock status of Gilson 30x pumps, where gilsonPumpObj is a valid serial
% object generated by gilsonPumpObj.  Status is false if unlocked, and true
% if locked.


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

% deviceID
deviceID = 1;

% fetches the status
status = gilsonpumpobjcomm('read', gilsonPumpObj, deviceID, '?');

% returns the ouput (there is a leading space to be ignored too)
if strcmp(status(2), 'U')
    % returns 0 for unlocked
    status = false;
    
elseif strcmp(status(2), 'L')
    % returns 1 for locked
    status = true;
    
else
    % errors
    error('Unknown keypad lock status.')
end

Contact us