Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Why acquired data aren't from min to max values (DAQmxCreateAIVoltageChan, PXI 4472)

Solved!
Go to solution

Hi ,

 

I'm developping a c program for the PXI 4472 acquistion device on opensuse 11.4 (linux 2.6.34).

 

I try to acquire analog data and to read them in a wav file.

I configure the acquisition task with the folowing functions:

 

DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","OnboardClock",DAQmx_Val_Cfg_Default,-10.0f,10.0f,DAQmx_Val_Volts,NULL);
DAQmxCfgSampClkTiming(taskHandle,"",48000,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,48000);   

DAQmxDisableStartTrig(taskHandle);

 

I don't understand why the stored data in the wav file are not from -10V to 10V but from -5V, 5V...(the value of the gain is 0dB). (Maybe a scale of 0.5?...)

 

Thanks for your help,

 

Amandine


 

 

0 Kudos
Message 1 of 6
(6,228 Views)

Hi,

 

Can you describe the signal you acquire ? What is the amplitude of that signal ?

 

Regards

0 Kudos
Message 2 of 6
(6,219 Views)

Hello!

 

First thanks to help me! 🙂

 

I investigated yesterday, and in fact my pb is not the one I described. As when I read the data, I use DAQmxReadBinaryI32, the data are unscaled (of course!), so the +/-10V I configured as the min and max voltage values aren't taken in account.

 

So my pb is: When I read the data in the buffer and when I try to calculate the voltage value, I have a factor of 1/2. Is it because the NI 4472 maximum value is not (2^23 - 1) * 2^8 but (2^22 - 1) * 2^8 (http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/0441cc9e6bf2a31d86256d96006f2715?O...)?

 

An anyway, what is the impact of this when I calculate: valueInVolt = Binary/2^31*10 

I'm sure I have made a (big) mistake somewhere...

0 Kudos
Message 3 of 6
(6,213 Views)

Hi,

 

Yes I think you get it. The maximum value you read in the buffer is (2^22-1)*28. Then assume the input voltage is 10V and you configured +/-10V as the max & min voltage values, the reading value is then 2^22-1 and you obtain :    valueInVolt = ((2^22-1)*2^8 / 2^31) * 20 -10

 

You have to multiply by 20 because the range is from -10V to 10V it means 20V. Then you just have to substract 10 V to center the valueInVolt.

 

Tell me if that helps you

0 Kudos
Message 4 of 6
(6,203 Views)

Hi,

 

I don't understand the -10. I presume that I have to subtract 10 if I use the binaryU32 and not the binaryI32, right? In this case, my pb is solved, thanks!

 

Amandine

0 Kudos
Message 5 of 6
(6,201 Views)
Solution
Accepted by topic author iclapa

You're right, in my example, I considered unsigned data.

 

Regards

0 Kudos
Message 6 of 6
(6,198 Views)