LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to determine which USB device is which?

I want to communicate between 4 USB devices and Labview via a USB hub and want to figure out which is connected to cable 1, which is connected to cable 2, etc. All 4 devices are the same, have the same hardware string and no unique serial number per device. Is there any way of doing this?
0 Kudos
Message 1 of 12
(3,729 Views)
I just have to ask, if they are all the same, why does it matter which is which?

I know, I know, they aren't really all the same. If you need some way to tell them apart and you don't have an electronic means to do so, you have to use a non-electronic means. Try asking the operator or running what ever gear is connected and see if you can tell through that.

I would need to know a bit more to be a bit more helpful.

Bob
0 Kudos
Message 2 of 12
(3,720 Views)
The 4 devices are in a box on a rotary platform and there is a hole in the box. I rotate each device so it can receive a signal through the hole in the box and need to talk to the specific device receiving the signal and take a measurement of the signal. This is why I need to know which device I am talking to.
0 Kudos
Message 3 of 12
(3,718 Views)
I am not sure about getting, through software, a way to determine which would be which.
If you have a couple of digital lines available on each you could set up a pattern for an ID:
00 = device 1
01 = device 2
10 = device 3
11 = device 4

Would require you to ties those two digital lines to ground/vcc etc to set the pattern but barring any other way this might be a work around.
0 Kudos
Message 4 of 12
(3,715 Views)
Also, this test cycle lasts a couple hours and each device is restarted a couple of times (assumably changing USB COM ports?). I can probably find a way to determine what order the devices are in at the beginning of the test, but I don't know how to after the restarts.

After the initial start, it is supposed to be an unmanned process, hence the attempt at automating with Labview.
0 Kudos
Message 5 of 12
(3,715 Views)


@ibthor wrote:
Also, this test cycle lasts a couple hours and each device is restarted a couple of times (assumably changing USB COM ports?). I can probably find a way to determine what order the devices are in at the beginning of the test, but I don't know how to after the restarts.

After the initial start, it is supposed to be an unmanned process, hence the attempt at automating with Labview.



It might be good to find an answer to the question in this post. Are they really changing USB COM ports when they are restarted? And are they all restarted at the same time? If they are not all restarted at the same time, you could just keep track of who is going off and who is coming on again. And if they are all restarting at the same time now, does it have to be that way?

Just some thoughts.

Hope that this helps,
Bob
0 Kudos
Message 6 of 12
(3,710 Views)
I don't know if they change COM ports when they come back on or not. If I hook the same device to HyperTerm in WinXP, it doesn't always take the same COM port.

As for turning them on in the same order, that gets complicated. I also have to factor in device failures. If device #3 fails, then device #2 fails, and I have to take a reading on device #3, I have to restart it and I am afraid it would then take the COM port of device #2, since that is the lowest on the totem pole, and then talking to the device I think is #3 would not be there.

Is there any other way than just picking a COM port to determine where my devices are connected?

If you haven't figured it out yet, I'm fairly new to Labview, but Google and searching this forum haven't yielded me any answers yet. Neither has NI Tech Support.
0 Kudos
Message 7 of 12
(3,706 Views)
This may answer some of your questions:

http://blogs.msdn.com/oldnewthing/archive/2004/11/10/255047.aspx

If you can find where Windows enumerates the devices (on a by-connection basis), you may be able to at least find out which USB port you're talking to, then it's just a matter of making sure that device A gets hooked up to port A every time
0 Kudos
Message 8 of 12
(3,695 Views)
batesbc - I followed the link you gave me, and it proved for an interesting read and a nice Microsoft bashing, but everyone acknowledges the problem and no one gives answers. I'm beginning to feel like Windows is going to be my limitation.

I have this problem solved under a Linux 2.6.x kernel, but I'm being pushed towards finding a Windows solution.
0 Kudos
Message 9 of 12
(3,671 Views)
Take a look at this as well

Using NI-VISA 3.0 to Control Your USB Device


Hope this link make sense 😛

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 10 of 12
(3,654 Views)