High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

How are offset and gain in the niScope fetch function arrived at when data is output in an integer (raw) format?

I'm using a PCI-5124, and in my application I'm offloading data in a 2D I16 format using the niScope Fetch block in Labview 7.1.  I notice that these scaling factors change depending on what kind of data I feed in.  It would seem that these scaling factors (gain and offset) would be fixed given a specific range as set in the niScope vertical configuration block.  For instance, with the 12-bit data range where the highest signed integer number would be 2047, and the range set to 10 volts (-5 to 5 volts), and offset to 0, it would seem obvious that gain and offset would be set as follows:
 
offset = 0
gain = 5/2048 = 0.00244140625
 
The resulting numbers I retrieve are close, but not the same as I would expect.  What's happenning?  Can I set a fixed scale, or am I at the mercy of the niScope Fetch block?
 
Kevin
0 Kudos
Message 1 of 2
(6,527 Views)
We prefer to say, the tender mercies of the Fetch block.

You'll notice the "wfm info" cluster as an output of the Fetch VI.  This cluster has gain and offset members- use these to scale your binary data to floating point voltage representation.

As you point out, the numbers won't be exactly what you expect given the vertical range and the device resolution.  There are a few reasons for this.  First, we don't use the absolute full scale of the ADC for the maximum input voltage.  There are a couple of codes of headroom at the top and bottom.  This allows your input signal to slightly exceed the specified vertical range without clipping (you'll get a warning from the driver).  Second, these gain and offset numbers take into account calibration information for your device.  Using these numbers will correct for small deviations from the ideal offset and gain.

So if you use the gain and offset numbers from the driver, your measurements will be more accurate than if you assume 0 offset and perfect gain.  They will be most accurate if you make sure to perform a self-calibration once the device is in your system and at the temperature that your tests will be run.
0 Kudos
Message 2 of 2
(6,522 Views)