Chapter 3
Adjustment
3-22
ni.com
D0 Constant
1.
Enable the analog filter by calling the function
ni54xx_SetAnalogFilter
. Set the following parameters:
•
sessionHandle
—The handle of the calibration session for the
device
•
filterState
—
NI54XX_ENABLE
.
2.
Generate a full scale (10 V) sine wave at 1000 Hz by calling the function
ni54xx_GenerateWaveform
. Set the following parameters:
•
sessionHandle
—The handle of the calibration session for the
device
•
waveType
—
NI54XX_SINE
•
amplitudeInVolts
—
10
•
frequencyInHz
—
1000
3.
Set the gain and offset using
ni54xx_SetAdjustedGainAndOffset
with 0 offset and 0 attenuation in the unterminated case. Set the
following parameters:
•
sessionHandle
—The handle of the calibration session for the
device
•
offsetInVolts
—
0
•
attenuationInDb
—
0
•
terminationState
—
NI54XX_UNTERMINATED
4.
Set a 50% duty cycle by calling the function
ni54xx_SetDutyCycle
.
Set the following parameters:
•
sessionHandle
—The handle of the calibration session for the
device
•
dutyCycle
—
50
5.
Measure the duty cycle (
currentDutyCycle
).
6.
While the |measured duty cycle – 50| is larger than the tolerance
(0.1 or larger as determined by your application):
a.
Call
ni54xx_CalAdjust
for D0 to calculate the next “best-guess”
based on the previous results. The
measuredData
should be a
pointer to the measured duty cycle. The
actualData
should be a
pointer to the desired duty cycle (in this case, 50). Call the function
ni54xx_CalAdjust
using the following parameters:
•
sessionHandle
—The handle of the calibration session for the
device
•
measurementMode
—
NI54XX_SET_D0