• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

How to detect if COM Port exists?

Started by NigelL, November 17, 2013, 02:42:52 pm

Previous topic - Next topic

NigelL

Hi

Is there a way to check if a specific COM Port still exists?

I am doing a "LoadConfig" from the Registry, to restore the last-used COM Port, but get an error if this port no longer exists (e.g. if USB-Serial adaptor has been removed).

Regards, Nigel

Roman Novgorodov

Hello

You can use following methods and properties for getting serial port list and try to find necessary port before open it:

    procedure GetDeviceList(L:TStrings);
    property DeviceIndex:integer;
    property Device[Index:integer]:TnrDevice;
    property DeviceCount:integer;


Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.