george seifert Posted January 11, 2007 Report Share Posted January 11, 2007 I have a USB device that comes with a driver that makes the USB port look like a COM port. I'd like to be able to automatically detect which COM port it picked. The only way I can see to do that is to match something like the Driver Provider that shows up in the Driver tab under the COM port properties in the Windows Device Manager to the manufacturer of the device. I don't have a clue how to retrieve that info. Can anyone get me started? George Quote Link to comment
Rolf Kalbermatter Posted January 11, 2007 Report Share Posted January 11, 2007 I have a USB device that comes with a driver that makes the USB port look like a COM port. I'd like to be able to automatically detect which COM port it picked. The only way I can see to do that is to match something like the Driver Provider that shows up in the Driver tab under the COM port properties in the Windows Device Manager to the manufacturer of the device. I don't have a clue how to retrieve that info. Can anyone get me started?George Checkout VISA properties. If you have a VISA refnum you can get various properties for that and the Interface Information->Interface Description should contain extra information in the string for other than built in serial ports. Rolf Kalbermatter Quote Link to comment
george seifert Posted January 11, 2007 Author Report Share Posted January 11, 2007 Checkout VISA properties. If you have a VISA refnum you can get various properties for that and the Interface Information->Interface Description should contain extra information in the string for other than built in serial ports.Rolf Kalbermatter Thanks Rolf, but I tried that. The Interface Description just returns "COM4 - USB Serial Port". Not quite enough to narrow it down. I went through all the properties and none of them give me anything useful. I suspect I'd have to use some type of Windows function, but have no idea which one and have no idea how to figure out which function I need. George Quote Link to comment
Rolf Kalbermatter Posted January 12, 2007 Report Share Posted January 12, 2007 Thanks Rolf, but I tried that. The Interface Description just returns "COM4 - USB Serial Port". Not quite enough to narrow it down. I went through all the properties and none of them give me anything useful. I suspect I'd have to use some type of Windows function, but have no idea which one and have no idea how to figure out which function I need. Hmm, I know having seen VISA returning me interface specific information. If I only knew where! I guess if you really want to go the Windows API route you will have to check into SetupAPI (no this is not pretty and an external DLL will most likely help faciliate that significantly) or you could try to look in the registry. A starting point here might be http://msdn2.microsoft.com/en-us/library/aa909922.aspx. Rolf Kalbermatter Quote Link to comment
Ton Plomp Posted January 12, 2007 Report Share Posted January 12, 2007 Maybe here: VISA\Serial Instr\Version INformation\Resource Manufacturer Name Found it with the class browser (ctrl-shift-b): Ton Quote Link to comment
george seifert Posted January 12, 2007 Author Report Share Posted January 12, 2007 Maybe here:VISA\Serial Instr\Version INformation\Resource Manufacturer Name Found it with the class browser (ctrl-shift-b): Ton Nope. That returns the VISA manufacturer. In this case National Instruments. I've tried every property in the list. Rolf, I don't really want to go the Windows API route, but I don't see another way. George Quote Link to comment
James N Posted January 12, 2007 Report Share Posted January 12, 2007 A coworker of mine had a similar problem of not knowing which "ID number" a USB device decided to pick when connected. Since he had only one device in the test system, at launch he would loop through the possible ID numbers and send a specific command to each one. Which ever ID returned a valid response had to be the correct one. Not pretty but got the job done. -James Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.