09-05-2017 09:14 AM
Hello,
I'm attempting to make a DMA FIFO that uses a module number and channel number as a flag to tell the HMI how to decode the data. The reason I want to do this is to be able to turn channels on and off, as needed, and increase the speed the reads (if aiming for high speed logging).
Is there a way that I can programmatically interleave an array for putting into a DMA FIFO?
I.e if I had three channels, AI0, AI1 and AI2, and from my HMI I sent boolean to the FPGA saying 101, ie, send AI0 and AI2, how do I interleave for those two channels, prior to sending to the DMA FIFO.
Cheers,
Peter
09-05-2017 09:21 AM
Hi Peter,
there is a Interleave1DArrays function…
It always helps when you supply a sketch (or even an example VI) to illustrate your question!
How do you want to interleave data? Which data comes first, which next? How many samples? …
09-05-2017 09:38 AM - edited 09-05-2017 09:41 AM
Hi GerdW,
Sorry I wasn't all that clear. I want to interleave N channels to send through a DMA FIFO. The target end result is to have multiple channels (up to 8 voltage NI 9205, 8 current NI 9203, and a few custom channels). The user will then be able to select what channels he wants to be read and put through the DMA. The reason for wanting to do this programmatically on the FPGA side is to increase the possible logging frequency with lower number of channels, i.e. when using 1 voltage, the A/D converter is focusing solely on that single channel.
My initial plan was to use case structures, and some sort of interleaving:
But in this sort of design, I'll have to send through a zero or default number for the false cases, which will mean the DMA will alway be sending the same amount of information, regardless of the read speed of the module.
Edit: Hadn't finished replying.
Cheers,
Peter
09-05-2017 09:48 AM
I think instead you will have to send an array of booleans as well to tell the for loop which ones to actually enqueue.
You could also read this from the host to know which channels are enabled as well if needed.