04-27-2011 12:26 PM
For example, I am calling
DaqSystem.Local.GetPhysicalChannels(PhysicalChannelTypes.AI, PhysicalChannelAccess.External)
To obtain a list of connected devices. The return array data looks something like this:
cDAQ1Mod4/ai0 (etc.)
This tells me that I have a CompactDAQ chassis, which is good, and an analog module in the Module4 slot. What I need to know is not just that there is an analog module in the #4 slot, but also its capability (voltage, temperature, strain, etc.) so that I can use the correct DAQmx task for that module type. All of this must be discovered at runtime.
Otherwise, I will have to provide a configuration utility where the program user has to identify which module is plugged into which slot -- and if he changes this by moving it to another slot, he has to re-enter these details. I want to avoid this by making the hardware as discoverable as possible.
I may have overlooked an API -- and that's my hope.
**bleep**
Solved! Go to Solution.
04-28-2011 05:12 PM
Hi **bleep**,
The information that you want is found in the DAQmx C referance help file. To get there:
Start>> All programs>> National Instruments>> NI DAQ>> Text-Base Code Support>> DAQmx C referance help>> NI- DAQmx C Properties
There you will find device properties and channel properties. I hope that this helps.
Regards,
Perry S.
04-28-2011 05:33 PM
04-28-2011 05:36 PM
Perry,
IMO, the DAQMx .NET library should expose this function. If that isn't possible, then an example of how to PInvoke it using C# or VB.NET.
At the end of the day, what I need is a list of the modules that are plugged into a chassis, by model number. For example, "NI9201" or equivalent. That way, I can make sure that I am using the correct DAQMx task, since I have a separate one for each basic module category (analog input, thermocouple input, RTD input, etc.).
For this purpose, the return from DaqSystem.Local.GetPhysicalChannels or DaqSystem.Local.Devices doesn't do the job. If I have to PInvoke some low-level method, I need help with the syntax.
**bleep**
05-02-2011 05:45 PM
Hi,
I was able figure out the syntax for you. Here it is.
Device blah = DaqSystem.Local.LoadDevice("cDAQ1");
foreach (String dev in blah.ChassisModuleDeviceNames)
{
label1.Text += "\n" + DaqSystem.Local.LoadDevice(dev).ProductType;
}
This prints out the model number of all of the cDAQ modules in the chassi. I hope that this helps.
Regards,
Perry S.
05-06-2011 06:54 PM - edited 05-06-2011 06:55 PM
Hi,
NI-DAQmx 9.3 added some new properties to return the AI supported measurement types for a specific device or channel:
NationalInstruments.DAQmx.Device.AISupportedMeasurementTypes
NationalInstruments.DAQmx.PhysicalChannel.AISupportedMeasurementTypes
For example, this Powershell code:
[System.Reflection.Assembly]::LoadWithPartialName("NationalInstruments.DAQmx")
[NationalInstruments.DAQmx.DaqSystem]::Local.LoadDevice("Dev1").AISupportedMeasurementTypes
has the following output with an NI 6259 installed as Dev1:
Current
Resistance
StrainGage
Rtd
Thermistor
Thermocouple
BuiltInTemperatureSensor
Voltage
VoltageCustomWithExcitation
Brad
10-10-2016 01:25 PM
Hi Perry,
I am not familiar with C programming. Is there a way of achieving graphically what you have described below?
Chundra
=======
10-11-2016 04:07 PM
Hello,
You can programmaticaly find DAQmx Device names within LabVIEW.
Check out the example below:
Programmatically Determine what cDAQ Modules are in a Chassis