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.

realtermserial(varargin)
function handle = realtermserial(varargin)
% REALTERMSERIAL works similar to serial objects, although currently only
% the basic properties (baud rate, flow control etc etc) are supported.

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

% designed to not break!
try
    % creates a serial object with the specified values
    serialObject = serial(varargin{:});

    % then creates a real term activeX server using the properties of the
    % serial object
    handle = realterm(handle);
    
catch
    % deletes the serial object if it didn't work
    if exist('serialObject', 'var')
        % delete it
        delete(serialObject)
    end

    % rethrow the error
    rethrow(error)
end

Contact us