Справочник Пользователя для National Instruments 321645c-01

Скачать
Страница из 554
Chapter 2
Function Reference — Lab_ISCAN_Op
NI-DAQ FRM for PC Compatibles
2-268
©
 National Instruments Corporation
finalScanOrder is an array that indicates the scan channel order of the data in the buffer 
passed to 
Lab_ISCAN_Op
. The size of finalScanOrder must be at least equal to the number 
of channels scanned. This parameter is valid only when the error is returned to zero and is 
useful only when pretrigger mode is enabled (Lab and 1200 Series devices only).
If you do not use pretrigger mode, the values contained in finalScanOrder are, in 
single-ended mode, n-1, n-2, ..., 1, 0, in that order, and in differential mode, 2 (n–1), 2 (n–2), 
..., 1, 0, in that order, where n is the number of channels scanned. For example, if you scanned 
three channels in single-ended mode, the finalScanOrder returns:
finalScanOrder[0] = 2.
finalScanOrder[1] = 1.
finalScanOrder[2] = 0.
So the first sample in the buffer belongs to channel 2, the second sample belongs to channel 
1, the third sample belongs to channel 0, the fourth sample belongs to channel 2, and so on. 
This is exactly the scan order you would expect from the Lab and 1200 Series devices and 
finalScanOrder is not useful in this case.
If you use pretrigger mode, the order of the channel numbers in finalScanOrder depends on 
where in the scan sequence the acquisition ended. This can vary because the stop trigger can 
occur in the middle of a scan sequence, which causes the acquisition to end in the middle of 
a scan sequence so that the oldest data point in the buffer can belong to any channel in the 
scan sequence. 
Lab_ISCAN_Op
 
rearranges the buffer so that the oldest data point is at index 
0 in the buffer. This rearrangement causes the scanning order to change. This new scanning 
order is returned by finalScanOrder. For example, if you scanned three channels, the original 
scan order is channel 2, channel 1, channel 0, channel 2, and so on. However, after the stop 
trigger, if the acquisition ends after taking a sample from channel 1, the oldest data point 
belongs to channel 0. 
So finalScanOrder returns:
finalScanOrder[0] = 0.
finalScanOrder[1] = 2.
finalScanOrder[2] = 1.
Therefore the first sample in the buffer belongs to channel 0, the second sample belongs to 
channel 2, the third sample belongs to channel 1, the fourth sample belongs to channel 0, 
and so on.
Using This Function
Lab_ISCAN_Op
 initiates a synchronous process of acquiring A/D conversion samples and 
storing them in a buffer. 
Lab_ISCAN_Op
 does not return control to your application until 
NI-DAQ acquires all the samples you want (or until an acquisition error occurs). When you 
use posttrigger mode, the process stores count A/D conversions in the buffer and ignores any 
subsequent conversions.