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.

isrealtermininstalled
function tf = isrealtermininstalled
% ISREALTERMINSTALLED checks if its installed or no
% tf = isrealterminstalled returns true or false depending on whether it
% thinks Realterm is installed or not (defined as being able to generate a
% functioning Realterm ActiveX server).

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

% tries to generate a realterm handle
try
    % tries
    handle = actxserver('realterm.realtermintf');
    
    % if it didn't error, it worked!
    tf = true;
    
    % try and clear up
    try
        % close it down
        handle.Close
        
    catch
        % warning
        warning('isRealTermInstalled:closeError', 'Could not properly close the Realterm ActiveX server on shutdown.')
    end
    
    % remove it too
    try
        % tries
        delete(handle)
        
    catch
        % warning again
        warning('isRealTermInstalled:deleteError', 'Did not correctly remove the Realterm handle from memory on shutdown.')
    end
        
catch
    % it did error - don't need to do anything to clear up
    
    % define the response as false
    tf = false;
end

Contact us