Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How are the names (Dev1, Dev2, etc) determined and stored?

Hi all,

My application calls for two PCI-6224 cards - They're working perfectly.

However, we recently set up a second system, identical to the first.   On the second system, the default names of the cards - Dev1, and Dev2, were now swapped around!   It was easy enough to rename them in Measurement & Automation Explorer, but I need to know how the names are assigned.  We plan to build several of these systems, and it's important that we know for sure which is Dev1 and Dev2 (My C++ program refers to them by name).

So, I guess my questions are...

  • How are the default names assigned?  Is it based on the order the cards are found on the PCI bus, or by serial number, or...?

  • Where are the names stored? (file, registry, ?)  What guarantees do we have that the names won't swap back again after (say) a reboot, or replacing a card?  Are the names tied to the serial # of the card?
Thanks!
Leif Bloomquist


0 Kudos
Message 1 of 4
(8,107 Views)
This link should answer some of your questions
 
 
 
0 Kudos
Message 2 of 4
(8,086 Views)

Hi Leif-

In addition to Dev's suggestion, you might also be interested to know about some of the device configuration information that's available via the DAQmx API.  For example, you can use DAQmxGetDevSerialNum(); or DAQmxGetDevPCIDevNum(); to get the serial number and PCI slot number of a device, respectively, by referencing it's device name (i.e. Dev1, etc). 

You can use these and other DAQmx Device Properties (documented in the NI-DAQmx C Reference Help under NI-DAQmx C Properties>>List of Device Properties) to design an application that is less reliant on the device names assigned by MAX.  To answer your original question, there is no obvious pattern or easily accessible storage area that you can query directly.

Hopefully this helps-

Tom W
National Instruments
Message 3 of 4
(8,076 Views)
Hi Leif,

I'd like to further address your last group of questions ("Where are the names stored? (file, registry, ?) What guarantees do we have that the names won't swap back again after (say) a reboot, or replacing a card?  Are the names tied to the serial # of the card?").

The device names are stored in a database in the MAX\Data directory. It is
used to persist configuration info (device names, terminal blocks, SCXI configurations, virtual TEDS smart sensor info, and such) across reboots. If you are duplicating a system with a complicated configuration, you can export it on one system and import it on the others (using File»Export... and File»Import...).

For PCI/PCIe/PXI/PXIe devices, DAQmx device names are tied to the PCI bus topology. If you replace a PCI card with the same model in the same slot, the replacement card will have the same device name. If you move a card from one slot to another, it will get a new device name.

Since the USB bus topology is much less static than the PCI bus topology, DAQmx device names are tied to the serial number for USB devices. Replacing a USB device will give you a new device name (at least until you delete the old one and rename it).

CompactDAQ uses a mixture of the two approaches. Replacing a C Series module in the same slot preserves the device name, but replacing the chassis does not, since the chassis is a USB device.

Brad
---
Brad Keryan
NI R&D
Message 4 of 4
(8,055 Views)