PORTS Forum

Ports and Interfaces => Serial Ports => Topic started by: GlennP on December 13, 2013, 10:39:43 am

Title: Sorting out which device is connected to which port...
Post by: GlennP on December 13, 2013, 10:39:43 am
Just doing some mods to some base code in VB, and am looking for a way to tell which instrument is plugged into which port, the best idea I have so far come up with is to list all the ports and open them (two reply 9600, one 19K2 and the other at 1200) and send the Id request to them if the port will open at 19K2 I have one instrument, 1200 the other, then last two request ID command.  Is there a way of doing this more elegantly or is this the only way to do it?
Glenn   
Title: Re: Sorting out which device is connected to which port...
Post by: Jan Axelson on December 13, 2013, 11:07:22 am
You could try this:

http://stackoverflow.com/questions/4500027/get-the-device-name-connected-to-the-serial-port
Title: Re: Sorting out which device is connected to which port...
Post by: GlennP on December 13, 2013, 12:13:41 pm
Thank Jan I will look at it Monday (it's late Friday this side of the Atlantic) also you might be interested an article I wrote for the CodeProject Web site
http://www.codeproject.com/Articles/678025/Serial-Comms-in-Csharp-for-Beginners , there probably is more than a few similarity's to some of your examples. (quaking as he types!) please if you think it suitable link to it....   
Title: Re: Sorting out which device is connected to which port...
Post by: Jan Axelson on December 13, 2013, 03:03:47 pm
Nice! I'll add a link in my next website update.