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

Скачать
Страница из 554
Chapter 2
Function Reference — SCAN_Demux
©
 National Instruments Corporation
2-295
NI-DAQ FRM for PC Compatibles
numMuxBrds is the number of AMUX-64T devices used during the multiple-channel 
acquisition. NI-DAQ ignores this parameter for the DAQCard-500/700 and 516, Lab and 
1200 Series, and LPM devices and DSA devices.
Range:
0, 1, 2, or 4.
Using This Function
If your buffer was initially declared as a two-dimensional array after 
SCAN_Demux
 rearranges 
your data, you can access any point acquired from any channel by specifying the channel in 
the first dimension and the data point in the second dimension. For example, suppose NI-DAQ 
scanned channels 3 and 5 and buffer is zero based. Then buffer[0][9] contains the 10th data 
point (numbering starts at zero) scanned from channel 3 (the first of the two channels), and 
buffer[1][14] contains the 15th data point acquired from channel 5. 
If the number of channels scanned varies each time you run your program, you probably 
should be using a one-dimensional array to hold the data. You can index this array in the 
following manner after 
SCAN_Demux
 performs its rearrangement to access any point acquired 
from any channel (again, suppose that channels 3 and 5 were scanned).
count is the total number of data points acquired.
total_chans
 is the total number of channels scanned (different from numChans if 
numMuxBrds is greater than zero).
points_per_chan
 is then the number of data points acquired from each channel 
(that is, count/total_chans).
buffer[0 * points_per_chan + 9] contains the 10th data point scanned from channel 3.
buffer[1 * points_per_chan + 14] contains the 15th data point acquired at channel 5.