Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

write spreadsheet file.vi per long data

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(4,465 Views)

Of course it is possible.  Where is the data coming from?  What is your data rate?  Do you absolutely need a delimited text file?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(4,460 Views)

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.

0 Kudos
Message 3 of 5
(4,448 Views)
Solution
Accepted by topic author Saille

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(4,431 Views)

I did a cleaning in the program as you said, it was very good.

thank you

0 Kudos
Message 5 of 5
(4,418 Views)