LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to do gData to 2D-Array

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.

0 Kudos
Message 1 of 2
(3,300 Views)

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);



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,296 Views)