06-30-2020 09:01 AM
Greetings,
I am trying to learn how to make the FPGA in my cRIO-9040 store data to a csv. file located in a flash drive connected to the device. I already know how to store data to files, but haven't yet learned how to do so from the FPGA.
From what I understood from reading other threads, I have to create two separate VIs, one assigned to the FPGA for obtaining the data to be stored (e.g. from the module inputs), and a second one assigned to my cRIO outside the FPGA which writes the data to the file.
So my question is how do I make these two VIs share data. Do I have to use a FIFO, global variables, or something else entirely? Which blocks do I need to use in each VI in order to make this work? Is there a simpler or better method?
Thank you,
José
Solved! Go to Solution.
06-30-2020
09:40 AM
- last edited on
01-06-2025
03:26 PM
by
Content Cleaner
In order to store the data on the cRIO, you'll need to (as you describe) use the RT/cRIO side to actually save the data. You can use standard VIs to do this, like Write to Text File or similar.
To get data from the FPGA to the RT 'Main VI', you can use a variety of methods depending on the data amount.
There's an NI tutorial here: Communication Between the FPGA, Real-Time Processor, and Distributed Systems (read the first section).
You can also get the links from the bottom row middle column of table 2 here: https://www.ni.com/en/support/documentation/supplemental/16/understanding-communication-options-betw...
In short though, if you have a lot of data, probably you'll want to use DMA FIFOs. I fairly strongly suspect this is your most appropriate choice.
For smaller volumes of data you might consider reading/writing the front panel controls or similar (using some sort of handshaking methods).
06-30-2020 10:36 AM
Thank you very much.
I think I begin to understand what I have to do.