Manual Number: 00650-014-4
Page 5-18
AD12-8 Manual
params[1] = 3;
/* counter mode 3, square wave generator */
params[2] = 100; /* counter load value, acts as divide by 100 */
aa16drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
Task 15: Read Counter/Timer Count
Reads the count of the given counter/timer.
Notes:
1. For a complete discussion of the counter/timers, see
CHAPTER EIGHT: PROGRAM-
MABLE INTERVAL TIMER
.
2. Counter/timer is latched before read.
Input:
params[0]: counter number 0, 1 or 2.
Output:
Data:
params[1]: counter/timer count.
Error Codes:
status = 0: No error.
status = 1: Invalid task number, task > 17, or driver not initialized.
status = 8: Invalid counter, not 0, 1 or 2.
Example:
int task,params[5],status;
/* these are globally declared variables */
task = 15;
params[0] = 1;
/* counter 1 */
a12drv(FP_OFF(&task),FP_OFF(params),FP_OFF(&status));
/* call the driver */
Task 16: High Speed Conversions, Single Point Address
Fetch multiple conversions a single point.
Notes:
1. This task will use the gain set up in TASK 4, or the function assignments set up in TASK 10.
2. This task uses a single data buffer. The number of conversions must not exceed the length of
the 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.