Manual Number: 00650-014-4
Page 5-10
AD12-8 Manual
Output:
Data:
params[3]: Number of conversions completed.
The buffers will contain the conversions and the point/gain data respectively.
Error Codes:
status = 0: No error.
status = 1: Invalid task number, task > 17, or driver not initialized.
status = 3: Card does not respond.
status = 5: Point list error, list empty.
Example:
int task,params[5],status;
/* these are globally declared variables */
int datbuf[100],chnbuf[100];
/* these are globally declared variables */
task = 8;
params[0] = FP_OFF(datbuf);
/* pass offset of data buffer */
params[1] = FP_OFF(chnbuf);
/* pass offset of point/gain buffer */
params[2] = 100; /* number of conversions */
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
Task 9: Interrupt Driven Data Acquisition
Provides subtasks to perform buffered data acquisition using interrupts. Sub task functions include
initiating the interrupt conversions, checking for completion and stopping the interrupt process.
Notes:
1. Each time a point is fetched from the list, the list index is incremented. The list index can be reset
to the beginning of the point list by TASK 11.
2. The initial call to SUBTASK 1 passes a pointer to a data buffer to store he conversion. This
buffer is used as temporary storage by the driver. A subsequent call to SUBTASK 3 will place
the data into two separate buffers; a data buffer for the conversion results and a point/gain
buffer to contain the point address and the gain used for the conversion.
3. The point and gain for each analog input is returned in the point/gain buffer. The point address
and gain are packed into one integer with the point address in the upper eight bits and the gain
in the lower eight bits. Both the data buffer and the point/gain buffer should be integer buffers
of the same length. The number of conversions must not exceed the length of the shortest
buffer or else other areas of computer memory may be corrupted causing unpredictable computer
behavior. The driver has no criteria to evaluate the validity of the pointer. It is incumbent upon
the application program to supply a valid buffer pointer.
4. The data and point/gain buffers must be declared globally or the driver will not be able to find
their segment.
5. This task has several functions, each having its own required parameters.