Author Topic: (disconnected) Port detection  (Read 6914 times)

moelski

  • Full Member
  • ***
  • Posts: 122
    • View Profile
(disconnected) Port detection
« on: June 15, 2009, 01:08:22 am »
Hi Roman,

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

Quote
epFullInfo 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:
Quote
To 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
« Last Edit: June 16, 2009, 04:34:33 am by moelski »

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #1 on: June 15, 2009, 01:58:11 am »
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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #2 on: June 15, 2009, 02:14:25 am »
Hi Roman,

Quote
epFullInfo 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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #3 on: June 15, 2009, 05:35:45 am »
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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #4 on: June 15, 2009, 05:42:11 am »
Hi Roman,

Quote
I 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.

Quote
Possible you forget to call TnrComm.Update() method after change TnrComm.EnumPorts = epFullInfo
Even if I call Update there are no more ports.

Quote
Also 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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #5 on: June 15, 2009, 05:59:46 am »
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
« Last Edit: June 15, 2009, 06:19:05 am by 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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #6 on: June 15, 2009, 06:09:27 am »
Hi Roman,

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

Quote
COM55, 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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #7 on: June 16, 2009, 05:49:48 am »
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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #8 on: June 16, 2009, 08:16:33 am »
Hello Roman,

find the results attached ...

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #9 on: June 16, 2009, 12:42:01 pm »
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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #10 on: June 16, 2009, 03:23:57 pm »
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #11 on: June 16, 2009, 11:33:25 pm »
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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #12 on: June 17, 2009, 12:40:56 am »
Hi Roman,

Quote
1) 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.

Quote
2) 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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: (disconnected) Port detection
« Reply #13 on: June 17, 2009, 12:51:45 am »
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

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: (disconnected) Port detection
« Reply #14 on: June 17, 2009, 01:34:24 am »
Hi Roman,

Quote
If you see one COM16 it's correct.
I see one COM16.

Quote
Please 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.