To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example demonstrates how to de-interleave a 1D array that contains data of multiple channels.
Description
If you are using a DMA FIFO to transfer multiple channels of data from an FPGA VI to a host VI through an interleaving technique, you will invariably need to break that data back into the individual channels in the host VI. Traditionally, the best way to do this is using the Decimate 1D Array function to break it back down into each of the channels followed by the Build Array function which builds the data back into a 2D array. A VI Snippet which illustrates this technique is shown below.
The technique is fine if the number of channels of data you are transferring is fixed. If you need to vary the number of channels you are transferring without modifying the code, you can use a technique which uses the Reshape Array function which is shown in this example. The output will be a 2D array where each row contains values of one channel. If the quotient of Interleaved Data values and Number of Channels is not an integer, remaining values are ignored.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
useful
very good! that's exactly what i'm looking for!
Code attached in the second snippet takes out the first array and moves it to the back of the 2D array. I think this is unintentional.
As above, anyone knows why the last two blocks is there?