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.

tharbprobjreadallcurrent.m
function [profile, valveControlStatus, valvePosition, currentTemp, setPress, currentPress, extHeaterStatus, extSetTemp, extCurrentTemp] = tharbprobjreadallcurrent(tharBPRObj)
% THARBPROBJREADALLCURRENT reads all current parameters of Thar BPRs
% [profile, valveControlStatus, valvePosition, currentTemp, setPress,
% currentPress, extHeaterStatus, extSetTemp, extCurrentTemp] =
% tharbprobjreadallcurrent(tharBPRObj) reads the profile, the valve control
% status ('on' or 'off'), the valve position (an integer from 0 to 6000),
% the current valve temperature, the set pressure, the current pressure,
% the external heater status ('on' or 'off'), the external heater set
% temperature, and the current external heater temperature. where
% tharBPRObj is the BPR serial object (generated by tharbproj).  The
% pressure is returned in bar, and the temperature in C.

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

% navigates to main display menu and fetches contents of screen
response = tharbprobjdisplaymenu(tharBPRObj);

% extracts everything out
profile = response{2}(9);
valveControlStatus = lower(strtrim(response{2}(18:20)));
valvePosition = str2double(response{3}(5:8));
currentTemp = str2double(response{3}(17:19));
setPress = str2double(response{4}(5:7));
currentPress = str2double(response{4}(17:19));

% navigates into the second part of the display menu
tharbprobjcomm('write', tharBPRObj, 19)

% reads that out
response2 = tharbprobjcomm('read', tharBPRObj);

% extracts out some more data
extHeaterStatus = lower(strtrim(response2{2}(16:18)));
extSetTemp = str2double(response2{3}(5:7));
extCurrentTemp = str2double(response2{3}(18:20));

% navigates back to the main display menu
tharbprobjcomm('write', tharBPRObj, 19)

Contact us