Chapter 5: AD12-8 Driver Reference
Manual Number: 00650-014-4
Page 5-9
Output:
Data:
params[0]: Point address converted.
params[1]: Resulting conversion data.
params[2]: Gain code used.
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: Invalid point address, or index.
Example:
int task,params[5],status;
/* these are globally declared variables */
task = 7;
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
Task 8: Fetch Multiple Buffered Conversions
Fetch multiple conversions from the point list, using polling.
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, SUBTASK 1.
2. This task uses two buffers, a data buffer and a point/gain buffer. Both buffers 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.
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.
4. The buffers must be declared globally or the driver will not be able to find their segment.
Input:
params[0]: Offset of the data buffer address.
params[1]: Offset of the point/gain buffer address.
params[2]: Number of conversions to make.