Measurement Computing Data Acquisition Systems rev.10.4 User Manual
Page 143

Retrieving the Calibration Constants
The gains and offsets constants for the handle, channel, gain and range entries selected are set
for the device and stored in the memory pointed to by the corresponding parameters gainConstant and
offsetConstant
parameters respectively. The values returned are stored in a 16-bit data word which
applies to the current settings for the selected table entry. These values need to be calculated and set by the
calibration application according to the methods described below.
Interpreting Calibration Constant Values
These calibration constants are gains and offsets that are applied to the input data. After the data comes in, it is
multiplied by the gain, and then the offset is added to it. The resulting data has been converted from raw A/D
data to calibrated analog data. Each channel, gain, and bipolar/unipolar range setting has a different pair of
gain and offset values.
As mentioned above, the first three parameters of the daqCalSetConstants function specify which set of
constants are to be changed. The last two parameters are the actual constants. These constants are in a
particular binary format. The gain constant is 32,768 times the gain. For a gain of x1, the gain constant is
32,768 or 0x8000. The maximum gain is approximately x2 (65,535 / 32,768), and the minimum gain is x 0 (0 /
32,768). The offset (a left-justified signed 12-bit number) is added to the final result. A single least-significant
bit has an integer value of 16 or 0x0010. Setting the calibration constants affects subsequent acquisitions until
another daqOpen is performed. After daqOpen, the original calibration constants are re-read from the
NVRAM in the WaveBook and expansion chassis; then, the working copy as set by daqCalSetConstants
is overwritten.
Prototypes
C/C++
daqCalSetConstants(DaqHandleT handle, DWORD channel, DaqAdcGain gain,
DaqAdcRangeT range, WORD gainConstant, SHORT offsetConstant);
Visual BASIC
VBdaqCalSetConstants(ByVal handle&, ByVal channel, ByVal gain, ByVal
range, ByVal gainConstant, ByVal offsetConstant);
Program References
None
Programmer’s Manual
908494
Daq API Command Reference 4.3-17