Calibrates an ADC Channel
Gx3348CalAdc (nHandle, nGroup, nChannel, dRefPostive, dRefNegative, dMeasurePositive, dMeasureNegative, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle for the PXI board. |
nGroup |
SHORT |
Selects the group to calibrate0. GX3348_GROUP_A: Calibrates an ADC Channel from Group A1. GX3348_GROUP_B: Calibrates an ADC Channel from Group B2. GX3348_GROUP_C: Calibrates an ADC Channel from Group C3. GX3348_GROUP_D: Calibrates an ADC Channel from Group D |
nChannel |
DOUBLE |
Selects the ADC channel within a group to calibrate |
dRefPostive |
DOUBLE |
Sets the positive measurement taken from an external DMM |
dRefNegative |
DOUBLE |
Sets the negative measurement taken from an external DMM |
dMeasurePositive |
DOUBLE |
Sets the positive measurement taken from the ADC channel |
dMeasureNegative |
DOUBLE |
Sets the negative measurement taken from the ADC channel |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
This function calibrates and ADC channel by using the internal DAC to source voltages. Calibration of the ADC does require external DMM. Calling Gx3348CalWriteEEPROM will finalize the calibration.
The following example calibrates all ADC channels:
SHORT nHandle, nStatus, nGroup, nChannel;
DOUBLE dMeasurePositive, dMeasureNegative, dRefPositive, dRefNegative;
Gx3348Initialize (1, &nHandle, &nStatus);
Gx3348CalSetMode(nHandle, GX3348_CAL_MODE_ENABLED, &nStatus);
for(nGroup=0; nGroup<3; nGroup++)
{
for(nChannel=0; nChannel<16; nChannel++)
{
Gx3348SetRelay(nHandle, GX3348_RAIL_DAC_A, nGroup, nChannel, TRUE, &nStatus);
Gx3348CalSetDacVoltagePoint(nHandle, GX3348_RAIL_DAC_A, GX3348_CAL_DAC_VOLTAGE_POINT_POSITIVE, &nStatus);
DMMMeasure(&dRefPositive);
Gx3348Measure(nHandle, nGroup, nChannel, &dMeasurePositive, &nStatus);
Gx3348CalSetDacVoltagePoint(nHandle, GX3348_RAIL_DAC_A, GX3348_CAL_DAC_VOLTAGE_POINT_NEGATIVE, &nStatus);
DMMMeasure(&dMeasureNegative);
Gx3348Measure(nHandle, nGroup, nChannel, &dMeasureNegative, &nStatus);
Gx3348CalAdc(nHandle, nGroup, nChannel, dRefPositive, dRefNegative, dMeasurePositive, dMeasureNegative, &nStatus);
}
}
Gx3348CalWriteEEPROM(nHandle, &nStatus);
Gx3348CalDac, Gx3348CalSetDacVoltagePoint Gx3348CalWriteEEPROM, GxPdoGetErrorString