06-25-2007 10:03 AM - last edited on 06-24-2013 09:45 AM by JordanG
Hello,
With the function "DAQmxReadAnalogF64" I read 50 samples per chan and I do samples in a buffer gData. When there is only one channel, gData buffer size will be 50samples but when we have 2 channels, gData buffer size become 100samples. But I'd like to do gData samples in a 2D-Array where I can have the number of the channel and all samples of this channel.
How can I do the gData in a 2D-Array when I have many channels .
Thanks a lot.
06-25-2007 10:35 AM
If you set "Fill mode" to DAQmx_Val_GroupByChannel, all measures from the first channel will be in the first 50 elements of your array, next the 50 measures from the second channel. At this point, some simple Copy1D instructions will permit you to transfer your measures to separate arrays or to a 2D array:
Copy1D (gData, 50, a1);
Copy1D (gData + 50, 50, a2);