Chapter 6: AD12-8 Windows Driver Reference
Manual Number: 00650-014-4
Page 6-11
Notes:
The total number of conversions taken is equal to the
scans
parameter multiplied by the
convs
parameter.
After setting up the process,
AD128_IRQScan
will exit, before conversions are complete. The
process will run as a background task.
Desired portions of the point list may be converted by setting the
index
parameter. The
index
parameter is a numerical value that indicates which position in the point list to start each scan.
Each succeeding scan will start at this point in the point list. To start at the beginning of the point
list use a zero for this parameter.
For the source of start conversions, you may pass one of the provided constants that are located in
the include files,
A12DRV.H
for C and
A12DRV.GBL
for Visual BASIC. The constants are
SOFT-
WARE
,
TIMER
(
TTIMER
for Visual BASIC) and
EXTERNAL
.
If the counter/timer is to be used to start conversions, then before calling the
AD128_IRQScan
routine, you should set up the timers by using
AD128_RateGenerator
to set the desired conver-
sion frequency.
If a window handle is passed in the
hWnd
parameter, than the driver will post a message to that
window upon completion of all conversions. If you do not wish to use this feature, pass a 0 in
Visual BASIC or a NULL in C. Alternatively, you may poll from time-to-time to check if all
conversions are complete by calling
AD128_IRQStatus.
The data taken are stored in the driver with no curve functions or scaling performed. After calling
this routine, a call to
AD128_PostProcess()
will return the data with all functions and scaling
performed. The call to
AD128_PostProcess()
should have identical values for
scans
,
convs
and
index
as the call to
AD128_ IRQScan()
.
Error Codes:
LIST_EMPTY:
The point list is empty.
INVALID_CONV:
The
scans
and/or
convs
parameter < 1.
INVALID_IRQ:
The IRQ parameter is not <= 2 and <= 7.
PROCESS_ERROR:
Start conversion source is not 0, 1, 2.
ACTIVE_PROCESS:
A batch process is currently active in the driver.
WINDOWSERROR:
A Windows related error occurred.
LIST_ERROR:
An error occurred traversing the point list.
AD128_SUCCESS:
Operation was performed without error.
AD128_PollScan
Function:
Scans a portion, or the entire point list a given number of times. This is a
batch process that will poll the card until each conversion is complete.
Syntax:
Visual BASIC:
AD128_PollScan(Byval scans as Integer, Byval convs as Integer, Byval
index as Integer) as Integer