Appendix B Calibration Sample Program
VXI-SC-1102/B/C User Manual B-4
©
National Instruments Corporation
{SCXI_Change_Chan (vxiChassisID, moduleSlot, moduleChan);
/* Select the channel. */
printf("Apply input voltage for point 1, channel %d, gain %.0f.\n"
moduleChan, gain);,
vInput1 = enterFloat ("Enter VXI-SC-1102 input voltage: ");
/* User enters vInput1. */
vOutput1 = enterFloat ("Enter VXI-SC-1102 output voltage: ");
/* User enters vOutput1. */
printf("Apply input voltage for point 2, channel %d, gain
%.0f.\n",moduleChan, gain);
vInput2 = enterFloat ("Enter VXI-SC-1102 input voltage: ");
/* User enters vInput2. */
vOutput2 = enterFloat ("Enter VXI-SC-1102 output voltage: ");
/* User enters vOutput2. */
binOutput1= vOutput1*scale;
binOutput2= vOutput2*scale; /* Convert to DAQ board's format. */
SCXI_Cal_Constants (vxiChassisID, moduleSlot, moduleChan,
2, NIDAQMEM, dummyRangeCode, gain,
dummyDAQboard, dummyDAQchan, dummyDAQgain, 1,
vInput1, binOutput1, vInput2, binOutput2,
&binOffset, &gainerr);
/* Calculate offset & gain error. */
offset = binOffset/scale; /* Convert from DAQ board format. */
printf("Calculated offset %f V, gain ratio (actual/ideal) %f"
"and stored in NI-DAQ memory.\n\n", offset, gainerr);
}
}
}