11-07-2016 04:11 AM
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!
11-07-2016 04:33 AM
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.
11-07-2016 05:29 AM
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
11-07-2016 06:44 AM
@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.