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

(disconnected) Port detection

Started by moelski, June 14, 2009, 10:08:22 pm

Previous topic - Next topic

moelski

June 14, 2009, 10:08:22 pm Last Edit: June 16, 2009, 01:34:33 am by moelski
Hi Roman,

yesterday I read this posting from you:
http://forums.nrcommlib.com/index.php?topic=9.0

QuoteepFullInfo Mode
Mode returns full possible information about all detected serial ports


Well you only get the ports which are activated and available. But there could be many port which are disconnected (USB - serial converter). If you use the Devicemanager you are able to see this ports and get a lot of information about that.

To view the diconnected devices use this:
QuoteTo show all installed devices, follow these steps:
1. Open a command prompt
2. Enter the following:
SET DEVMGR_SHOW_NONPRESENT_DEVICES=1
cd %systemroot%\system32
start compmgmt.msc
3. Select the Device Manager node and turn on the "Show Hidden Devices" feature by clicking the appropiate entry in the View menu. The Device Manager will now list all devices that are installed on the machine.


Do you see any chance to detect this ports, too? I have many customers which are in trouble because of the disconnected devices. The COM number increases every time you connect a new device to the computer.
Maybe you can add a special EnumPorts property like:
- epDisconnectedFullInfo   (detect only the disconnected ports)
- epAllYouCanFindFullInfo  (detect all ports - connected and disconnected)

Greetz Dominik

Roman Novgorodov

Hello

epFullInfo shows me all ports (nonpresent too).
Plese try to build and run
Demos\SerialPortInfo\SerialPortInfo.dpr
with different values: epFullInfo and epFullPresent of TnrComm component.
Demo shows the different lists of detected serial ports.





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

moelski

Hi Roman,

QuoteepFullInfo shows me all ports (nonpresent too).

Not for me.

There are a lot of disconnected ports which are not shown.
Please see the pictures:

My "Ports" section from the device manager.


Results from the Demo


I set EnumPorts to epFullInfo !

Greetz Dominik

btw: I´m not able to attach any picture to my posting. I got an error that I don´t have write access to the picture folder.

Roman Novgorodov

Hello

I see that you added Fill Old button into Serial Port Info demo.
I don't see your code.
Possible you forget to call TnrComm.Update() method after change TnrComm.EnumPorts = epFullInfo

Also please note that you have several ports with same name: COM17 and COM16
TnrComm ignores duplicate names during enumeration process.

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

moelski

Hi Roman,

QuoteI see that you added Fill Old button into Serial Port Info demo.
I don't see your code.

Forget about that. I use it only for my old port detection code.
It has nothing to do with nrcomm.

QuotePossible you forget to call TnrComm.Update() method after change TnrComm.EnumPorts = epFullInfo

Even if I call Update there are no more ports.

QuoteAlso please note that you have several ports with same name: COM17 and COM16
TnrComm ignores duplicate names during enumeration process.

Ok, but what about the ports 4 to 13? They are unique and won´t be added to the combobox.

Please keep in mind ... These ports are not plugged to my computer. So I can´t use them actually for data send / receive.

Greetz Dominik

Roman Novgorodov

June 15, 2009, 02:59:46 am #5 Last Edit: June 15, 2009, 03:19:05 am by Roman Novgorodov
Hello

It's strange.
I see that SerialPortInfo shows serial ports: COM3, COM8, COM55, COM56
But your device manager does not show them. It is impossible if use one PC for tests :-)

Please take and run this latest demo:
http://www.deepsoftware.com/nrcomm/serialportinfo.zip



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

moelski

Hi Roman,

QuoteCOM3, COM8

These are modems. They are listed as modem in the device manager and not as serial port !

QuoteCOM55, COM56

These are Com0Com Ports. They have an own section in the device manager called "Com0Com - serial port emulators".

Your last demo reports the same ports as my serialPortInfo.exe.
Nothing has changed. The deactivated / unplugged ports are not visible.

Greetz Dominik

Roman Novgorodov

Hello

Please try debug version SerialPortInfo2debug.exe

1) Run it.
2) Click (uncheck) check box
3) You will find a log file near exe file. Please send to me this log.

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

moelski

Hello Roman,

find the results attached ...

Roman Novgorodov

Hello

Thank you for information.
Please try new version of demo from attachment.

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

moelski

Hi Roman,

here are my results. It looks better  :)
Find my results attached.

There are two problems with that demo:
1) The com0com ports are not in the list. The old demo shows the ports (in a very basic way and without any information but they where visible). Take a look at the picture.
At the left side is the old Debug Demo and at the right side is the new demo.

2) The Device combobox "hangs" if there are ports with the same short name. I have three ports which use COM16. And if I click at one of the three COM16 ports it always selects the first one.
Example:
COM16 - Profilic .....
COM16 - Eltima Virtual Port
COM16 - Eltima Virtual Port

If you click on one of the Eltima Ports it always selects COM16 - Profilic ...
And if you use the (Arrow) Kewy Down at the ComboBox it hangs if there is one shortname used for more then one time.

But the detection itself looks good.

Greetz Dominik

Roman Novgorodov

Hello

Thank you for information.

Please try a new demo from attachment.
1) Fixed problem with duplictes port names.
2) Additional port names can be detected.

Please try it.

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

moelski

Hi Roman,

Quote1) Fixed problem with duplictes port names.

Well ... Now the duplicates are gone. So now I miss ports in the list.  ???

I think there must be a fix for the combobox in order to be able to handle duplicate port names.

Quote2) Additional port names can be detected.

Correct. They are back  :)
But there is still the question if you could implement Com0Com in a better way.
-> http://forums.nrcommlib.com/index.php?topic=109.0   ;)

Roman Novgorodov

Hello

Quote
Well ... Now the duplicates are gone. So now I miss ports in the list.


I don't understand. Do you see single COM16? If you don't see COM16 at all it is problem.
If you see one COM16 it's correct.
Please understand nrComm opens serial port by using its file name (COM1,COM16 etc.)
Therefore the duplicate names of serial ports are not needed for I/O operations.

Quote... if you could implement Com0Com in a better way.


We will think about this :-)

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

moelski

Hi Roman,

QuoteIf you see one COM16 it's correct.

I see one COM16.

QuotePlease understand nrComm opens serial port by using its file name (COM1,COM16 etc.)

Ok. I understand.
But could you think about a function which reports duplicate ports?
The demo "SerialPortInfo-827.exe" was able to detect all Ports - even the duplicates.

So I would be able to give the user an information that there maybe is a conflict with his port name configuration.