LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging getting progressively slower

Hi,

 

Receiving 3 readings, twice a second via serial comms.

Using 'Write to Measurement File' to log it with a timestamp to an excel file. 

 

Problem is, logging starts spaced half a second apart, but then logging gets slower and slower.

Complete noob here, any advice on how to make the writes more efficient?

Any advice gratefully received!

 

excel logging.jpg

0 Kudos
Message 1 of 4
(2,637 Views)

Each time you save a new value, the function has to open the Excel file. If the file gets large this might take some time.

Consider saving your data as TDMS instead of Excel (You can use same express vi, change the configuration. Although I personally never use the express functions). You can open the TDMS files in Excel as well.

0 Kudos
Message 2 of 4
(2,630 Views)

Change that Write to measurement file to primitives. Place an Open file outside the loop, use Write to spreadsheet file in the loop, and Close it after the loop. That way the file will be kept open and the file pointer will point to the end of the file, which should be the same speed regardless of file size.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(2,609 Views)

@Yamaeda wrote:

Change that Write to measurement file to primitives. Place an Open file outside the loop, use Write to spreadsheet file in the loop, and Close it after the loop. That way the file will be kept open and the file pointer will point to the end of the file, which should be the same speed regardless of file size.


Write To Spreadsheet File opens and closes the file.  It does not accept a file reference.  You actually need to use Format String or Array To Spreadsheet String and then Write Text File to save the data.  This method works well for tab or comma delimited files.


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
0 Kudos
Message 4 of 4
(2,594 Views)