08-01-2013 04:13 PM
I am trying to create a data logging application to run on the cRIO 9022 with the 9205, 9870, and 9853 modules. I have created a separate DMA FIFO to pass data from each module. Within the host VI I would like to take the data from the FIFOs and write it to different files. So far I have been able to pass the data through (and see it on the front panel) for the three modules. I am writing the data from the 9205 to a TDMA file (with no problems). The problem arises with the 9870 module. I would like to write this data right to a text file (to process later). I am not sure if I am overloading the system with this function or if I am using the "write to text" incorrectly. After running the program the text file is created but it just contains null values, not the values I am seeing on the front panel. I have attached a screen shot of the write to text location.
I am still pretty new at this, so there could be a few things wrong, but any help would be greatly appreciated!
Thanks!
08-01-2013 06:56 PM - edited 08-01-2013 06:58 PM
Lesson 1: Use Write Text Function with a path will overwrite all data already writed... in other words, all data still being updated at every iteration.
Easily Approach:
Open one instance of that desired file outside of the while loop and use Write Text Function inside of that loop, then the data will be appended at every iteration. Like that:
08-01-2013 07:17 PM
Your data looks like it is binary so you may want to try using the Write Binary File instead of using the text version. Text can sometimes do wierd things with what it thinks are EOL characters.
08-02-2013 09:43 AM
Thank you both for the suggestions. I have added in the recommendations and it has solved the overwriting problem, but I am still getting just null values in the text (or binary) file I am trying to write.
Before using a FIFO to pass the data I was running the system in scan mode. I have attached an image of the old VI I was using. This was writing the data from the serial device (the data from the device is in hex) to a text file without any problems. This is my first attempt with FPGA VIs, so I am thinking the problem might lie somewhere in there, but I am not sure where.