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
(74 Views)
Solution
Accepted by 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);
            }
-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 3
(43 Views)

Thank-you!👏

0 Kudos
Message 3 of 3
(25 Views)