Chapter 5: AD12-8 Driver Reference
Manual Number: 00650-014-4
Page 5-19
3. The buffer must be declared globally or the driver will not be able to find its segment.
Input:
params[0]: Offset of the data buffer address.
params[1]: Number of conversions to make.
params[2]: Point address to convert.
Output:
Data:
params[3]: Number of conversions completed.
The buffer will contain the conversions.
Error Codes:
status = 0: No error.
status = 1: Invalid task number, task > 17, or driver not initialized.
status = 3: Card does not respond.
Example:
int task,params[7],status;
/* these are globally declared variables */
int datbuf[100],chnbuf[100];
/* these are globally declared variables */
task = 16;
params[0] = FP_OFF(datbuf);
/* pass offset of data buffer */
params[1] = 100; /* number of conversions */
params[2] = 5;
/* channel 5 on the first AT16-P */
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
Task 17: High Speed Conversions, Multiple Point Addresses
Fetch multiple conversions from the point list using pipelining features of the AD12-8.
Notes:
1. The point list is used to determine which point addresses to convert.
2. This task will use the gain set up in TASK 4, but will not use the function assignments set up
in TASK 10.
3. 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.
4. 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.