Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the devices' and modules' name

Solved!
Go to solution

I can get devices and modules' physical channel (I use cDAQs)  but I wonder if there is any way to get what these cDAQ devices are?

"Dev1" --> NI 9074, cDAQ Modules: NI 9225, NI 9227

"Dev2" --> NI 9078, cDAQ Modules: NI 9234, NI 9234

 

0 Kudos
Message 1 of 2
(3,022 Views)
Solution
Accepted by rle2

Hey rle2,

 

I found a way to do this! I am basing it off of this example that shows how to do it in LabVIEW:

 

https://forums.ni.com/t5/Example-Programs/Get-cDAQ-Module-Types-in-LabVIEW/ta-p/3520083

 

I have a cDAQ chassis called "cDAQ3", and this code successfully prints out the type of all of the modules in the chassis:

 

Device dev = DaqSystem.Local.LoadDevice("cDAQ3");
string [] module_names = dev.ChassisModuleDeviceNames;
foreach (string module_name in module_names)
{
    Device module = DaqSystem.Local.LoadDevice(module_name);
    string type = module.ProductType;
    Console.WriteLine(type);
}

Cheers,

Ryan C.

Message 2 of 2
(2,983 Views)