02-02-2015 07:04 PM
sorry my English
I need to monitor and save data for three hours, voltage x time.
I would like that each 1000 sec, a new file would generate and save part of the measuring systems during the three hours.
is it possible?
My idea is to have different parts of a single measurement, the measuring systems in theory would not slow
obs: I'm using to write spreadsheet file.vi to save data
thanks
Solved! Go to Solution.
02-02-2015 08:20 PM
Of course it is possible. Where is the data coming from? What is your data rate? Do you absolutely need a delimited text file?
02-03-2015 04:52 AM - edited 02-03-2015 04:53 AM
Hi
Currently is being generated only one file.
After 3 hours the program is slow.
I would like that each 1000 sec, a new file would generate and save part of the measuring systems during the three hours.
02-03-2015 07:31 AM
Your code is getting slow because you are constantly building arrays. Each time you add to an array, a new memory location has to be made to hold the entire array. This gets very time consuming when the arrays get large.
Since you are using charts, you only need to write the current values to the chart. Now for the saving to the file, you should only open the file once before your loop and close it once after the loop. Inside, you want to use the Array To Spreadsheet String and the Write Text File functions in order to write your data to the file. This will be a lot more efficient than completely overwriting the file each loop like you are doing.
With these two fixes, there is no longer any reason to constantly build up your arrays. So those shift registers are not needed and get rid of some of those Insert Into Array (which should really be Build Array anyways). You only need to write the latest values anyways.
02-03-2015 10:24 AM
I did a cleaning in the program as you said, it was very good.
thank you