Manual Number: 00650-014-4
Page 5-12
AD12-8 Manual
Example:
int task,params[5],status;
/* these are globally declared variables */
int datbuf[100],chnbuf[100];
/* these are globally declared variables */
task = 9;
params[0] = 1;
/* initiate interrupt scan */
params[1] = 100; /* do 100 conversions on this scan */
params[2] = FP_OFF(datbuf);
/* pass offset of temporary data buffer */
params[3] = FP_SEG(datbuf);
/* pass segment of buffer */
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
params[0] = 2;
/* check for end of scan process */
do
{
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status)); /* call the driver */
}
while (params[1] != 0); /* wait until end of scan*/
/* or if you do not want to wait until end of scan */
task = 11
params[0] = 0;
/* stop interrupt process sub task */
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
Task 10: Thermocouple/Function Assignment
Provides subtasks to assign thermocouple curves and scaling factors to a given point address. A
subtask is also provided to use the thermocouple tables to linearize values passed to it.
Notes:
1. The built-in NBS tables are designed to convert A/D counts to temperature directly. When using
SUBTASK 1, the driver expects the passed counts to be multiplied by 16 if using the bipolar
mode, and multiplied by 8 if using a unipolar mode.
2. Curves are assigned to a point address by calling SUBTASK 2 with the ASCII code of one of
the curves listed in the table that follows. Also, temperature units are assigned in the same
manner.
3. If reference junction compensation using the AT16-P on board sensor is desired, then assign
this sensor to the point list as the first channel of a given AT16-P (ie. 0, 16,32,48 etc). Make
sure that the TMP jumpers are installed on the AT16-P. Finally, assign the curve T to this
point address using SUBTASK 2. Any other point addresses on the AT16-P will now be
junction compensated automatically by the driver each time a point address is converted.
4. The reference junction circuit on the AIM-16 card generates 24.4 mV/
o
C. The counts read in at
a gain of 1 are 2.44 millivolts/count. Thus, each count represents 0.1
o
C.
5. When thermocouple curves are assigned to a point address, it is also required to set that point
address to a particular gain using TASK 4. These gains are presented in the following table.
Note that two gain codes are presented for each thermocouple type, the one you use will depend
on the setting of the G/2 switch on the AT16-P. If G/2 is OFF, use the lower gain code, if G/
2 is ON then use the higher gain code.