From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

differentiate between two same usb devices

Solved!
Go to solution

Say If I have two or more similiar USB devices, how do I programmatically differentiate them and gave them proper alias?

 

Using  defined digital inputs would help to identify them?

 

Clement 

0 Kudos
Message 1 of 9
(4,262 Views)

Hello,

First :

How are they recognized by the computer ?

0 Kudos
Message 2 of 9
(4,257 Views)

Hi Astroboy,

 

What about getting your USB serial number to ID it ?

You can get it using MAX

 

BR,

Vincent

0 Kudos
Message 3 of 9
(4,254 Views)

What if it is troublesome to find the serial numbers and the operators just replace another device  and install, and started working right away?

0 Kudos
Message 4 of 9
(4,247 Views)

Following the link below could help you even if this is a french one...

I apologize i couldn't find the english one

http://www.ni.com/getting-started/set-up-hardware/instrument-control/f/usb-connect

 

I didn't undestand what you mean in your previous post so i hope this general link could help.

 

BR,

Vincent

0 Kudos
Message 5 of 9
(4,238 Views)

What USB devices?

Assuming NI-USB-DAQs reading the serial number is the rigth way to identify the USB device.

 

And easy done with the property nodes.

ident.png

However, it seems that you want to identify a test setup. So you need to use the (replaceable) USB device to identify what type of setup is connected.

Using spare inputs for this task is a typical way, and need idividual programming. A standard solution for sensor identification is TEDS.

 

And you can't make it fool proof, since fools are so genious!  😄 😄

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 9
(4,218 Views)

Ok  allow me to explain. I do not know if I have a better idea.

 

If I have 2 same models of the USB devices, connected to my laptop. These devices are connected to the machine together  and each has different purpose to operate.

If they are identified by employing two specified digital input lines. They are connected as bit 01 and bit 10 for each USB device as they play different operations.

Once they are connected and they are auto given aliases. Then temporary tasks are loaded to find find the status of the digital input lines. Once they are identified and given proper aliases and the actual tasks will be loaded  and they can be used to perform operation, even wirhout having to find the serial numbers or give them aliases manually.

 

So if they are swapped or replaced with the same model, it will still work in the same way as long as they are identified by their digial inputs and perform the correct  operations.

 

What do yiou think?

 

 Clement

0 Kudos
Message 7 of 9
(4,174 Views)
Solution
Accepted by topic author astroboy

Your solution with two DI is a common method. BTW the same method is used with fligth turbine engines, an identifying connector is chained to the turbine and the controller board(s) can be replaced.

I would write a little subvi with DAQmx task in / out and a (type def'd) enum input for the setup, a true/false output (maybe together with a custom error on the error out)  and add that after every create task.

If the ID of the the setup fails, output a message and/or enter the auto alias process.

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 8 of 9
(4,159 Views)

Yup I've used, and like the jumper method when extra DIO is available.  If you go based on the serial number you might have issues when you swap around hardware.  I've often seen during debugging someone will grab a piece of hardware from another tester to see if an issue follows the wiring or follows the hardware.  Having external jumpers as a method of identification isn't perfect but I've seen cause less issues than using a hardcoded serial number.

0 Kudos
Message 9 of 9
(4,140 Views)