ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Querying USB-DAQ device type in C#

Solved!
Go to solution

I am trying to query the USB-6001 DAQ in VS2022 (C#) - Windows 10 with .NET 4.5 Framework, with the NI DAQmx and Common DLLs added as references - to determine the device present before configuring the various parameters etc.

The app is a fairly simple one to query a few external A/D voltages. 

 

Using the following returns "Dev1" but what I'm really after is a more elaborate Device type, if that exists (eg "USB-6001"):

  • string[] strDevices = DaqSystem.Local.Devices; 

 

Q: Is there a function that allows one to query that device info?

0 Kudos
Message 1 of 3
(834 Views)
Solution
Accepted by topic author Geehman

Use Device class to access its properties.

 

            Console.WriteLine("Alias\t\tType");
            string[] strDevices = DaqSystem.Local.Devices;
            foreach (string strDev in strDevices)
            {
                Device dev = DaqSystem.Local.LoadDevice(strDev);
                Console.WriteLine(strDev + "\t\t" + dev.ProductType);
            }
-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 3
(803 Views)

Thank-you!👏

0 Kudos
Message 3 of 3
(785 Views)