01-29-2009 03:08 PM
Could someone please give me an example of how to use DAQmxGetDevAIGains? Like many functions in the DAQmx C API, I can find only the barest of documentation. The documentation shows:
int32 __CFUNC DAQmxGetDevAIGains(const char device[], float64 *data, uInt32 arraySizeInSamples);
DAQmxGetDevAIGains gets the I/O Type >> Analog Input >> Gains property
I tried using it like so:
double gains[32];
int err = DAQmxGetDevAIGains("PXI2Slot2", gains, 32);
where the device at PXI2Slot2 is a PXI-6250. The call returns with err == 0, but the gains array is filled with garbage (-7.8e+298). I've already created a task and at least one AI channel before I try to get the gains. What am I doing wrong?
Thanks,
Larry
01-30-2009 07:31 PM
Hi Larry,
I am familiar with a similar property that I can use withoput problem in LabVIEW. Let me if I can find an example in C that will help us figure out what you are doing wrong. I will post back monday afternoon with an update.
What environment are you programming in? If you would like to, you could also post your code and I can take a look at it.
Regards,
Mallori
02-02-2009 10:08 AM
AI Gain is pretty much only used on SCXI devices so when you query it for for available gains on a regular DAQ card it just returns an empty array. What you're probably looking for is DAQmxGetDevAIVoltageRngs().
Cheers,
Andrew S
02-02-2009 06:19 PM
Hi Larry,
He makes a good point. I believe I have only used the Gains property node with Dynamic Signal Acquisition (DSA) cards and SCXI in the past. Some links that you might find helpful with regards to DAQmxGetDevAIVoltageRngs() are:
Format of DAQmxGetDevAIVoltageRngs
how to list AI input ranges by daqmx
I hope this helps,
Mallori