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.

tharbprobjsetprofile(tharBPRObj, profile)
function tharbprobjsetprofile(tharBPRObj, profile)
% THARBPROBJSETPROFILE sets the profile of Thar BPRs
% tharbprobjsetprofile(tharBPRObj) sets the current profile of Thar BPRs.
% tharBPRObj is the BPR serial object (generated by tharbproj). The profile
% is either 'A' or 'B'.

% e.g. tharbprobjsetprofile(tharbprobj(5), 'A') changes the current profile
% of the Thar BPR on COM5 to 'A'.

% Range:

% tharBPRObj = valid serial port object

% error handling
if ~nargin
    % errors
    error('Insufficient arguments')
elseif ~istharbprobjprofile(profile)
    % errors
    error('Profile must be either A or B.')
% navigate to display menu

% selects a profile, enters through everything, then presses 'N' - this
% changes the current profile, but is quick since it does not have to save
% a new configuration
tharbprobjcomm('write', tharBPRObj, [20, uint8(profile), 13, 13])

% have to check the current menu
response = tharbprobjcomm('readnoflush', tharBPRObj);

% if the menu is the save setup screen, press 'N' now, otherwise press
% enter twice more (to skip past the external heater temperature fields),
% then press 'N'
if strcmp(response{3}(1:4), 'Save')
    % sets the keys to be pressed
    keyStrokes = 'N';
    % changes...
    keyStrokes = [13, 13, uint8('N')];

% writes command, and navigates back to the display menu
tharbprobjcomm('write', tharBPRObj, keyStrokes)

Contact us