Code covered by the BSD License  

Highlights from
Thar ABPR-20 RS232 communication via handheld emulation

Thar ABPR-20 RS232 communication via handheld emulation

by

 

20 May 2013 (Updated )

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

tharbprobjreadcurrentprofile(serialObject)
function currentProfile = tharbprobjreadcurrentprofile(serialObject)
% THARBPROBJREADCURRENTPROFILE reads the current profile of Thar BPRs
% currentProfile = tharbprobjreadcurrentprofile(serialObject) reads the
% current profile of Thar BPRs. serialObject is the BPR serial object
% (generated by tharbproj). The profile is either 'A' or 'B'.

% e.g. currentProfile = tharbprobjreadcurrentprofile(serialObject) -
% returns the current profile of the Thar BPR e.g. 'A'.

% Range:

% serialObject = valid serial port object


% check the number of arguments
error(nargchk(1, 1, nargin))
    
% navigates to main display menu and fetches contents of screen
response = tharbprobjdisplaymenu(serialObject);

% the current profile is on the 2nd line of the screen (if on the first F3
% screen)
currentProfile = response{2}(9);

% checks the profile and error it it isn't valid
if ~istharbprobjprofile(currentProfile)
    % error
    error('Unexpected profile returned.')
end

Contact us