12-03-2007 08:42 AM - edited 12-03-2007 08:43 AM
12-05-2007 04:16 AM
12-05-2007 05:12 AM - edited 12-05-2007 05:13 AM
12-05-2007 09:44 AM
12-05-2007 11:00 AM
Hi,
You can programmatically get the device scaling coefficients using DAQmxGetAIDevScalingCoeff(). This returns the scaling polynomial, though in the case of a 6008 it's just an offset and a gain. The calculation should be:
voltage = reading*gain + offset
I didn't have a chance to try this out in C, I just confirmed it from LabVIEW so let me know if you run into problems implementing that scaling.
Cheers,
Andrew S
12-05-2007 05:31 PM
12-06-2007 02:37 PM
Hi,
Sorry, it looks like I didn't explain that well. This KB talks more about the polynomial returned. In the case of the 6008, the scaling coefficients from DAQmxGetAIDevScalingCoeff()returned is just a first order polynomial - it just returns ao (what I refer to as offset) and a1 (gain).
I whipped up an example for the 6009 and it should work for the 6008 - I wrote the code in CVI but you should be able to use snippets for whatever ANSI C environment you are in. It wouldn't work for any device that has a higher order scaling equation (like M-Series) but might work for E-Series. Also, I'm a little rusty in C so don't make fun of my code - and feel free to correct it and post back.
Cheers,
Andrew S
12-07-2007 07:37 AM
12-07-2007 08:56 AM
12-07-2007 04:28 PM