Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

query DAQmx module model

Hello,
 
How do you query the model name of the module plugged in a cDAQ9172? 
 
Thanks,
A
0 Kudos
Message 1 of 6
(8,441 Views)

angelmcdoggie,

 

Take a look at this knowledge base article that describes how to list all of your configured NI Hardware in many different programming Languages.

Ryan N
National Instruments
Application Engineer
ni.com/support
0 Kudos
Message 2 of 6
(8,423 Views)
thanks for the info.  Robot Happy
I tried the function mentioned but it's not the data that I am expecting.
The feature/ parameter that I am after is the module name, e.i. NI 9263.
Still looking for it and hopefully am able to figure it out how to use it.
 
Best regards,
A
 
0 Kudos
Message 3 of 6
(8,410 Views)

angelmcdoggie,

The above knowledge base article will give you a list of all the NI hardware attached to your system.  To get more information on each of those devices you will need to use the CNiDAQmxDevice class.  For example to get the hardware identification number (ex. NI USB 6009) you will want to use:

CNiDAQmxSystem::LoadDevice("DEVICE_NAME").ProductNumber;

You can then replace “DEVICE_NAME” with the results from:

CNiDAQmxSystem::GetDevices();

Ryan N
National Instruments
Application Engineer
ni.com/support
0 Kudos
Message 4 of 6
(8,403 Views)
Hello Ryan,
 
I am able to execute this one-> CNiDAQmxSystem::GetDevices();
The ProductNumber is a member of the CNiDAQmxDevice class.
 
I wrote, CNiDAQmxDevice device = CNiDAQmxSystem::LoadDevice(deviceName),  to create an instance of this class.
I tried using the ProductNumber but all my attempts were unsuccessful.
 
Please point it to me directly about the usage of the ProductNumber and also the ChassisMOduleDeviceName.
 
Thanks a bunch,
A
0 Kudos
Message 5 of 6
(8,394 Views)

angelmcdoggie,

I used the following code snippet to grab the devices in my system and determine their device types.  You will need to add code to manage an array of strings to keep the device list throughout your program.

NI::CNiStringVector myVector = CNiDAQmxSystem::GetDevices();

CString deviceType;

 

for(int i=0; i<myVector.GetSize(); i++) {

      deviceType = CNiDAQmxSystem::LoadDevice(myVector[i]).ProductType;  //Gets device name for every element in the vector then returns the product type

}

Ryan N
National Instruments
Application Engineer
ni.com/support
0 Kudos
Message 6 of 6
(8,382 Views)