01-04-2017 09:13 AM
Hi,
I am trying to save data plots into a text file which is tab separated. An array of data is added to the end of the file every second. This is to be done until it reaches a revovling buffer target time, which is currently 3300secs (55mins). At this point the newest data point will overwrite the oldest point in the file.
If an error occurs the effect off the revolving buffer stops and the data is still to be saved to to file for a further 300secs (5mins).
The issue I believe I am having is when the data in the array differs from a previous data array. (number of decimals in an element). A lot of empty elements get added to the end of the file. Could anyone please suggest a way of saving the data without having this problem.
I have attached a .vi to simulate the revolving save buffer. I have reduced the time from 3300 secs to 5secs and, 300secs to 2secs.
In order for the .vi to work a folder muist be created in the following directory- C:\cycles\results
The examples of the results have been attached and can be veiwed in notepad or microsoft excel.
Thank you
01-04-2017 09:26 AM
I would just use the Data Queue PtByPt VI to create your circular buffer and then just overwrite your file whenever new data comes in.
01-04-2017 09:47 AM
Some more hints:
I strongly suggest you to learn how to program a proper State Machine, and go through the online tutorials or teaching material. Here is some more reading: