Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

configure device in code

I would like to set the device number of my PCI6023E in C++ code in stead of using MAX, is this possible?
0 Kudos
Message 1 of 4
(2,971 Views)
Stephan,

As far as I'm concerned, this is not possible programmatically. The DAQ device number is a unique number assigned to each board to facilitate software calls through the NI-DAQ driver. The DAQ Device Number is usually the same as the PCI Device Number, but the PCI Device Number cannot be changed, and the DAQ Device Number can only be changed in MAX.

You can, however, change the NI-DAQ configuration file used by MAX. But you have to access the registry to do so. See example:

http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/334942e7223a04c58625696200602085?OpenDocument

You might also find interesting the following example that shows how to programmatically detect the device number of your PCI-6023E board:

http://zone.
ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/12284c844bea32b7862569420055be02?OpenDocument

Regards,
Azucena
0 Kudos
Message 2 of 4
(2,971 Views)
Azucena,

Thanks for you answer. Unfortunately, I do not have Labview on my PC, so I cannot view the config files or the VI's. However, changing the registry settings is not such a hard job for a C++ programmer, a I am. I did find some registry locations in the Help of MAX but could not find the location where settings such as the device number are stored. Do yo know where I can find a description of these registry keys/locations?
0 Kudos
Message 3 of 4
(2,971 Views)
Sorry about that!
The VI is modifying the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\NI-DAQ\CurrentVersion\Configuration Manager\

On my machine this value is set to:
C:\WINNT\NIa01292.daq

but you can change it to point to any other location. The *.daq file contains the device configuration you're interested in. However, I do not know of a way to modify the file directly. It seems that only MAX is able to do that.

Hope this helps,

Azucena
0 Kudos
Message 4 of 4
(2,971 Views)