03-28-2018 11:09 AM
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...
03-28-2018 11:20 AM
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.
03-28-2018 06:34 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-28-2018 09:47 PM
... and the RGT has some good Examples (I wrote one, myself ...).
Bob Schor
04-05-2018 01:34 AM
great, but please mind that I'm reporting a bug....
It Write measurement to file is so bad why are NI keeping it?
04-05-2018 07:38 AM - edited 04-05-2018 07:38 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-06-2018 01:33 AM
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!
04-06-2018 07:27 AM - edited 04-06-2018 07:28 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord