12-22-2011 10:40 AM
The DaqSystem.GetPhysicalChannels method can be used to enumerate the analog input channels that are available on a board. Is there an equivalent method that allows you to enumerate the differential channels?
Or is there a programmatic way to find the individual channels that form a single differential channel?
12-23-2011 09:01 AM
From what I have looked at thus far, there are no methods in Measurement Studio that return a list of terminals or single-ended channels used for differential channels. Up to a certain point, logic can be used to select the physical channels that are appropriate for use in the CreateVoltageChannel method. That is each differential channel is made up of two physical channels:
For a USB-6008
Differential Channel Physical AI + Physical AI -
AI0 AI 0 AI 4
AI1 AI 1 AI 5
AI2 AI 2 AI 6
AI3 AI 3 AI 7
This information is crucial when calling the CreateVoltageChannel method, so that you don't erroneously use a channel twice. When you call CreateVoltageChannel with AI 0 and Differential Input, it book-keeps AI 4 as also being in use.
For a USB-6363
Differential Channel Physical AI + Physical AI -
AI0 AI 0 AI 8
AI1 AI 1 AI 9
AI2 AI 2 AI 10
AI3 AI 3 AI 11
AI4 AI 4 AI 12
AI5 AI 5 AI 13
AI6 AI 6 AI 14
AI7 AI 7 AI 15
AI16 AI 16 AI 24
AI17 AI 17 AI 25
AI18 AI 18 AI 26
AI19 AI 19 AI 27
AI20 AI 20 AI 28
AI21 AI 21 AI 29
AI22 AI 22 AI 30
AI23 AI 23 AI 31
Note the jump from AI7 to AI16.
If you are developing an application that can be used with multiple Multi-Function DAQs, it is probably safest to add a set of supporting data tables to store the terminal assignments for differential channels. Populate these tables from the manual and lookup the board type when calling CreateVoltageChannel to create differential channels.
12-27-2011 02:30 PM
Hi DKIMZEY,
I think you are correct in what you have found regarding the existence of such a function, and you have a good workaround solution.
You may have already looked here, but you can view the NI-DAQmx library for NI-DAQmx .NET functions in:
Start>>Programs>>National Instruments>>NI-DAQ>>Text Based Code Support>>NI-DAQmx .NET Framework x.x Help