02-11-2011 06:17 AM
I aquire data with DAQmx and write the data to a TDMS-file . The input channel is scaled linear, as shown in the picture "Code Skalierung". In contrast to this linear scale the channel-Properties of the TDMS-file show a polynom scale with totally different values.
How can I scale my AI linear and the properties show the proper scale-values?
Solved! Go to Solution.
02-11-2011 09:47 PM
In DAQmx, we have scaling optimizations where scales will get combined whenever possible. In your case, we have a polynomial scale for your given device (probably an M-Series or X-Series device) that will take the raw 2 bytes value for a sample and scale it to voltage. Then, your linear scale on top of that scale will actually get combined into that scale so that m gets multipled by the second coefficient and the b offsetting the "offset" coefficient. For example, in a x^2 + b x + c, the resulting optimized expression would be a x ^2 + m b x + c + b. The same kind of optimization happens with linear on linear scaling and in some other cases. For example, if there were 5 linear scales "in a row", these would resolve to a single linear scale representing all levels.
This has some key advantages: 1) It optimizes the performance of the operations as it only has to apply one scale, and 2) it helps some with precision in terms of floating point math, 3) in the case of TDMS logging, it saves some space in the file.
If you want to validate that this is what's happening:
1) Look at the data coming from DAQmx Read and compare it to the TDMS file.
2) Look at the channel property for the device scaling coefficients (I believe it's under something like Analog Input>>General Properties>>Data Transfer>>Device Scaling Coefficients in the Channel property node). Then do the above calculation.
3) Try changing your m and b to something like 2x and see the resulting coefficients accordingly modified.
Hope this helps.
02-13-2011 09:56 PM
Sorry... I wasn't thinking straight when I typed the example resulting equation. When the device polynomial scaling is represented as ax^2 + bx + c, the resulting equation when combined with an mx + b1 scale would be m(ax^2 + bx+ c) + b1, or (m*a)x^2 + (m*b)x + (m*c) + b1.
02-14-2011 08:35 AM
To add on to Andy's information, the reason that many devices require a polynomial scale is because the Analog-to-Digital Converter (ADC) on the device has non-linearites at the upper and lower ends of the measurement range. A linear scaling of the raw data wouldn't well account for these non-linearities, resulting is poor accuracy and very high and very low readings. So instead, we use a polynomial scale that maps much better to the actual physical properties of the device.