Discussion:
Reading differential analog input in .NET DAQmx
(too old to reply)
jdlogicman
2008-08-08 16:10:10 UTC
Permalink
I'm not an EE, but I have to write a program in DAQmx for a PCI-6052E. One of the things I must do is acquire analog signals. I'm learning the concepts as I go, but translating them into the DAQms API is giving me a little trouble.
 
I can read individual analog inputs just fine, but I was told that two of the lines are differential to each other, i.e I am supposed to read one value that represents ai3 - ai11.
 
I saw the option for CreateVoltageChannel to use AITerminalConfiguration.Differential, but when I verify the task, I get an error that says I can't use differential mode. I didn't see any samples for how to encode the lines to read in a special way, so I used "/Dev1/ai3,/Dev1/ai11".
 
So, do I:
1- Just pass (AITerminalConfiguration)(-1), which lets DAQmx decide the right mode, and subtract the values I get?
2- Use an explicit mode (not -1) and do the same?
3- Something else?
 
Thanks much!
 
John Duddy
Bueller
2008-08-11 19:10:09 UTC
Permalink
Hi John,
 
When you set the terminal configuration to differential, DAQmx will automatically know what channels to read.
The way it works in differential measurement is that channels are separated by eight. For example if you are setting a measurement on ai0 , and the terminal configuration is differential, then the device will read ai0 and ai8.
In your case, only ai3 should be selected in software.
 
Please let me know if you have any further questions.
 
Regards,
Faris
jdlogicman
2008-08-11 19:40:11 UTC
Permalink
Thanks - that will help greatly. The next complication is that I need to acquire 2 differential and one non-differential signals at the same time. Is there a way to do this in a single task? Or a way to make sure that the measurements are all from the same period?
jdlogicman
2008-08-11 21:10:09 UTC
Permalink
Nevermind - I just added another input channel. Working like a dream now.
Bueller
2008-08-12 21:10:09 UTC
Permalink
Glad that it worked
 
 
Best regards,
Faris

Loading...