Appendix B
Calibration Sample Program
©
National Instruments Corporation
B-3
SCXI-1102/B/C User Manual
SCXI_Reset(SCXI_Chassis_ID, moduleSlot);
/*
In reset state, the module
will drive the MCH0+ output */
SCXI_Single_Chan_Setup(SCXI_Chassis_ID, moduleSlot, 0, dummyDAQboard);
/*
This is necessary only so that
SCXI_Change_Chan won't return
an error. */
for (moduleChan = 0; moduleChan < 31; mod+)
{
for (gain = 1; gain <= 100; gain = gain + 99)
{
SCXI_Change_Chan(SCXI_Chassis_ID, moduleSlot, moduleChan);
SCXI_Set_Gain(SCXI_Chassis_ID, moduleSlot, moduleChan, gain);
/* Select the channel and gain. */
printf("Apply input voltage for point 1, channel %d, gain %.0f.\n",
moduleChan, gain);
do
{
printf("Enter SCXI-1102 input voltage: ");
fflush(stdin);
ret = scanf("%lf", &vinput1);/* User enters vinput1. */
} while (!ret);
do
{
printf("Enter SCXI-1102 output voltage: ");
fflush(stdin);
ret = scanf("%lf", &voutput1);/* User enters voutput1. */
} while (!ret);
printf("Apply input voltage for point 2, channel %d,
gain %.0f.\n", moduleChan, gain);
do
{
printf("Enter SCXI-1102 input voltage: ");
fflush(stdin);
ret = scanf("%lf", &vinput2);/* User enters vinput2. */
} while (!ret);
do
{
printf("Enter SCXI-1102 output voltage: ");
fflush(stdin);
ret = scanf("%lf", &voutput2);/* User enters voutput2. */
} while (!ret);
bin_output1 = voutput1 * scale;
bin_output2 = voutput2 * scale; /* Convert to format of DAQ
board. */