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 data = tharbprobjreadall(tharBPRObj)
% THARBPROBJREADALL reads all current parameters of Thar BPRs
% data = tharbprobjreadall(tharBPRObj) the current valve temperature, the
% current pressure, the set pressure, where tharBPRObj is the BPR serial
% object (generated by tharbprobj).  The the temperature is returned in
% C, and the pressures in bar.

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

% pre-forms the data
data = cell(1, 6);

% tries to get the data
    % navigates to main display menu and fetches contents of screen - the
    % fast version is quicker, but does not seem to be as up to date
    %response = tharbprobjdisplaymenufast(tharBPRObj);
    response = tharbprobjdisplaymenu(tharBPRObj);

    % if it didn't error...
    if numel(response{3}) >= 19
        % gets the current temperature
        data{1} = str2double(response{3}(17:19));

    % checks there's enough data
    if numel(response{4}) >= 19
        % extracts out the current pressure
        data{3} = str2double(response{4}(17:19));

    % checks theres enough data again
    if numel(response{4}) >= 7
        % gets the set pressure
        data{4} = str2double(response{4}(5:7));

    % same again
    if numel(response{2}) >= 20
        % gets the status
        data{6} = onoff(lower(strtrim(response{2}(18:20))));

Contact us