LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to measurement file (.xlsx)- Append new data but in new sheet/table

Hi,

I have to export my data from LabVIEW to xlsx file, I'm doing it using "Write measurement to file" block set to xlsx file and overwrite when file exists.

Unfortunately time to time we're facing some hardware issues so I've been asked to save the measurement one each hour so we can recover some data in case of crash. I've simply putted a write measurement to file block into loop for the end of program.

Unfortunately each write appends file instead of overwriting it, so I have to delete it manually before the write...

0 Kudos
Message 1 of 8
(3,003 Views)

Just for data backup I would personally use a simple text or csv file. If someone is really pushing you to use .xlsx file type, I would look into the report generation toolkit.

Message 2 of 8
(2,999 Views)

Yup I also suggest the report generation toolkit.  It is free with several versions of LabVIEW (pro and maybe full?) and you can code it to do whatever you want.  The express VI Write to Measurement File is really only useful in small cases, and anything beyond that should be done with custom code.

0 Kudos
Message 3 of 8
(2,961 Views)

... and the RGT has some good Examples (I wrote one, myself ...).

 

Bob Schor

0 Kudos
Message 4 of 8
(2,948 Views)

great, but please mind that I'm reporting a bug....

It Write measurement to file is so bad why are NI keeping it?

0 Kudos
Message 5 of 8
(2,921 Views)

Its not a bug, sounds like a decent feature request.  Write Measurement isn't bad, and it isn't broken, it just doesn't meet your needs.  If I need to multiply two numbers, the add function isn't broken, it just isn't the right thing to use.  If you need a simple logging feature the Write Measurements may work just fine.  But as soon as you need a feature that it doesn't have, you'll want to look into writing code to do the logging yourself.

Message 6 of 8
(2,912 Views)

It's an obvious bug! In Form "If the file already exists" the option "append to file" appends the file, and the option "overwrite the file" also appends it instead of overwriting it!

0 Kudos
Message 7 of 8
(2,895 Views)

Without any context in your last message I was confused.  If it really does not overwrite the file then yes that would be a bug and a temporary solution until it is fixed, would be to delete the file before calling Write to measurement so it can't be appended.

0 Kudos
Message 8 of 8
(2,891 Views)