Appendix B
Calibration Sample Program
SCXI-1102/B/C User Manual
B-2
©
National Instruments Corporation
dummyDAQrange,
/*
These dummy variables would be used
if the measurement actually came
from a DAQ board and not an external
DMM. */
ret;
double
scale,
gain,
vinput1,
voutput1,
vinput2,
voutput2,
bin_output1,
bin_output2,
bin_offset,
gainerr,
offset;
do
{
printf("Enter the slot of the SCXI-1102: ");
fflush(stdin);
ret = scanf("%d", &moduleSlot);
} while (!ret || moduleSlot < 1 || moduleSlot > 4);
modulesPresent[moduleSlot - 1] = SCXI1102;
do
{
printf("Enter the chassis ID of the chassis containing the SCXI-1102: ");
fflush(stdin);
ret = scanf("%d", &SCXI_Chassis_ID);
} while (!ret);
commPath = SCXI_Chassis_ID;
do
{
printf("Enter the device number of the DAQ board communicating \n");
printf("with the chassis (default %d): ", SCXI_Chassis_ID);
fflush(stdin);
fgets(entry, 3, stdin);
if (strlen(entry) - 1) commPath = atof(entry);
} while (!commPath);
dummyDAQboard = connectionMap[moduleSlot - 1] = commPath;
/*
Since the DAQ board is not
used to acquire data, the
connectionMap does not need to
be accurate. */
dummyDAQrange = 5.0 / dummyDAQgain;
scale = pow(2.0, 12.0) * dummyDAQgain / 5;
/*
factor for converting to
format of 12-bit bipolar DAQ
board with 5 V full scale*/
SCXI_Set_Config(SCXI_Chassis_ID, 0, 0, 1, commPath, 4,
modulesPresent, operatingModes, connectionMap);
/*
Set up communication path to
module. */