Initiate and Fetch
Use the Initiate and
Fetch functions to perform other operations while the device acquires data.
Initiate begins the acquisition operation and returns control to your
program. Fetch transfers the acquired
data from acquisition onboard memory to your application.
The Initiate and Fetch VIs/functions are shown in the following table.
|
Note If you are programming in C, you must declare an array in
your program. This array allocates space for the data that is acquired with
the fetch functions. LabVIEW users do not need to declare an array because the
Fetch VIs allocate the array. |
If you fetch the data while the device is still acquiring, the function
waits until all the requested data has been acquired. If the data is not acquired within the time specified with the timeout parameter,
NI-HSDIO returns an error. If you want to stop the device before it finishes, use the
niHSDIO Abort VI
or the niHSDIO_Abort function. However, you
cannot fetch after aborting.
|
Tip Read the
NIHSDIO_ATTR_FETCH_BACKLOG
attribute before calling the fetch function to determine the number of samples available, or use the Fetch
Backlog property in LabVIEW (Dynamic Acquisition»Fetch Backlog) for
the same purpose. |
|
Note The read functions combine the initiate and fetch functions into one call.
The read functions are more suitable for simple acquisitions, while initiate/fetch is better
suited for complex applications that involve triggering. |