![Teledyne SP Devices ADQ7-FWATD User Manual Download Page 16](http://html1.mh-extra.com/html/teledyne-sp-devices/adq7-fwatd/adq7-fwatd_user-manual_1081090016.webp)
Classification
Revision
Public
PA6
Document Number
Date
17-1957
2018-06-07
way, e.g. by automatically changing the experiment parameters, since the data is returned to the user
once the measurement has completed.
Since the single-shot mode is quite straight-forward to grasp and use, most of the discussion in this
document is centered around the streaming mode. Any mention of
queues
should indicate to the reader
that the streaming mode is being discussed.
4.8.2
Streaming Mode
The streaming mode is centered around the use of a queue interface to transfer data between the device
and the user, see Fig.
3
. The user is responsible for keeping the queue filled with references to available
memory. The reuse of memory locations enables an unlimited amount of data using a limited amount of
memory.
Additionally, due to the continuous nature of the streaming mode, it is well suited for applications
which require a feedback mechanism to control devices placed earlier in the signal chain. However, the
loop delay cannot be given a constant value and will in practice depend on several factors, many of which
are beyond the control of the digitizer since the host computer is rarely using a real-time OS.
Data Collection Flowchart
Figure
4
presents a flowchart of the data collection loop in the streaming mode. Entering the loop,
the digitizer is assumed to be configured according to the user’s specification in regards to the trigger
configuration, clock source, filter coefficients etc. In the text below
buffer
is synonymous to a
user space
record
but specifically means the host memory allocated to hold the data.
1.
The first step in the outer loop is to set up the WFA engine by calling
ATDSetupWFA()
, specifying the
horizontal settings of the acquisition, i.e. the record length and any pre-trigger or trigger hold-off
values. Additionally, the number of accumulations per user space record as well as the number of
times to repeat the accumulation process, i.e. the number of user space records, is supplied as
arguments to this function. Furthermore, the memory allocated for the target buffers are registered
in the queue by calling
ATDRegisterWFABuffer()
.
2.
At this point, the WFA engine is primed and ready to collect data. The acquisition process is started
by calling
ATDStartWFA()
, arming the device. This function call launches a thread in the ADQAPI
which assumes control of the digitizer. Therefore, from this point on, it is crucial that the user only
calls supported
thread-safe
functions. Please refer to Section
4.11
for further details on threading.
3.
Once the WFA engine is running, the application enters the inner loop, repeating until the expected
amount of data has been received and processed or some unexpected event occurs.
When data is ready to be transferred to user space, the function
ATDWaitForWFABuffer()
will
return a reference to one of the registered buffers, informing the user which buffer has updated
contents. At this point, the memory reference is forgotten by the ADQAPI. The user is expected
to manipulate the data in whatever way mandated by the use case and then register the memory
reference as available memory once again. Thus, the memory is reused and in theory enables
observation of an unlimited amount of data using a limited amount of memory.
4.
Halting the WFA engine is carried out by calling
ATDStopWFA()
and then waiting for the internal
thread to close. The wait state is implemented by the function
ATDWaitForWFACompletion()
which
ADQ7-FWATD User Guide
www.teledyne-spdevices.com
Page 15 of 26