Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Consistency of multiple NI USB-6008 device numbering across machines

Solved!
Go to solution

I have some product testing hardware that we have built that contains 2 NI USB-6008 DAQ units. The test software is written in C++ with NI DAQmx. Everything works fine, except that when we plug the testing hardware into another PC, the two DAQ units get their device numbering reversed. This means that what was "Dev1/ai0" on one machine becomes "Dev2/ai0" on the second machine, and vice-versa. We only have two machines we work on - is there some way to configure the hardware to enumerate the same way on these two machines? Or do we need to uniquely identify the two DAQs by some other method?

 

Thanks,

 

Colby

0 Kudos
Message 1 of 6
(3,888 Views)
Solution
Accepted by cboles

What's happening Colby,

 

Welcome to the forums and thanks for your question.  There are two different ways that you can ensure that you always reference the same device.  The devices enumerate in your system based on the order they were added, so the first way would be to always plug them in in the same order.  This isn't really the most robust way of doing things, so you can also use the DAQmx property nodes.  

Now, I hope you will forgive me as my text based coding is terrible, but the functions you need are DAQmxGetSysDevNames() and DAQmxGetDevSerialNum().  I'll leave the coding up to you, but the Get Names property will return all devices in your system.  You can then pass these and get the Device Serial Number which will never change.  

 

For any LabVIEW users who come upon this post, here's what your code will look like:
DeviceSerialNumbers.png

You will want to be aware that this second approach will not work if you have an OEM application where all of the devices you are deploying will have a different serial numbers.  Hope this helps.  

ColeR
Field Engineer
Message 2 of 6
(3,874 Views)

Thanks - that should get me working for now as I only have one system with the two NI devices. In the future, we may need to make more of these testing systems, and the coding for specific serial numbers would be messy. We could add some sort of user configuration UI, but that would also be non-ideal.

 

Is there any accessible persistent user storage on the 6008 hardware? If there was, I could add an "A" and "B" marker to the two DAQs when we build the system, and the software would be able to correcty identify them in the field. I guess I could also build the system such that the lower serial numbered unit is always "A", or something like that...

 

Colby

0 Kudos
Message 3 of 6
(3,870 Views)

Hey Colby,

 

We provide a way to export your device configuration from one machine to another.  In Measurement and Automation Explorer (MAX), you can select File>>Export to save the configuration of your devices, MAX tasks, etc. When you go to import this configuration on a target machine, it will perform a matching algorithm to determine what devices on the target machine are the best matches for what is in the configuration file.  For example, if you export a device named "FrequencyTester" with a serial number of 0x1234 and go to a target machine whose serial number is 0x1234 but has a different name, this match will "win".  Other criteria are used to make the match most appropriate so that you can easily deploy your system.

 

Note that you can programmatically import/export as well using a function called NIMAX_CopyConfiguration.

Thanks,

Andy McRorie
NI R&D
Message 4 of 6
(3,843 Views)

Here's a clunky idea if you have any spare digital i/o channels:  do some hard wiring of these extra channels to "encode" an id that you can easily discover with a simple DIO Read. 

 

Example: since it appears that the digital inputs are pulled high when unwired, you can hard-wire DGND to one or more inputs as a pattern that id's the specific USB-6008.  Two bits gives you 4 unique binary-coded patterns, 3 gives you 8, etc.  Granted it wastes some i/o, but maybe still useful when deploying multiple systems whose USB DAQ's may get occasionally interchanged for troubleshooting or something.

 

-Kevin

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 5 of 6
(3,823 Views)

Thanks for all of the ideas. I ended up just building the test units with the serial numbers of the NI DAQ devices in increasing order. My software reads the serial numbers and enumerates the devices on that basis. That way no customization is need on the client PC other than installing the app and NIDAQmx.

 

Colby

Message 6 of 6
(3,693 Views)