Code covered by the BSD License  

Highlights from
Thar ABPR-20 RS232 communication via handheld emulation

Thar ABPR-20 RS232 communication via handheld emulation



20 May 2013 (Updated )

Controls and reads from a Thar ABPR-20, by emulating the handheld controller.

function valvePosition = tharbprobjreadvalveposition(tharBPRObj)
% BPROBJREADVALVEPOSITION reads the valve position of Thar BPRs
% valvePosition = tharbprobjreadvalveposition(tharBPRObj) reads the current
% valve position of Thar BPRs. tharBPRObj is the BPR serial object
% (generated by tharbproj). The valve position is a number from 0 to 6000,
% where 0 is completely closed.

% e.g. tharbprobjreadvalveposition(tharbprobj(5)) - returns the current
% valve position of the Thar BPR on COM5 e.g. 6 for 0006.)

% Range:

% tharBPRObj = valid serial port object

% error handling
if ~nargin
    % errors
    error('Insufficient arguments')

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

% the current valve position is the second number on the 4th line of the
% screen (if on the first F3 screen)
valvePosition = str2double(response{3}(5:8));

Contact us