LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write labview measurement file vi appends file when overwrite selected

I am using the Write Labview Measurement File Express VI in a subVI with the overwrite file option selected. The first time I call the subVI it works fine. Each call thereafter the file is appended rather than overwritten. I am having similar problems with the Read Labview Measurement File VI. It works the first time called. Every call after the first results in error 4 (EOF error) as if the pointer never gets reset to the beginning of the file.
0 Kudos
Message 1 of 4
(2,865 Views)
Hello,

You are correct with your assumption that the pointer is not resetting to the beginning of the file. The reason you are receiving error 4 is because the Read LabVIEW Measurement File Express VI has some flags that prevent it from reading the same file once it hits the end of the file. These flags will be reset in LabVIEW everytime the VI starts but if you are trying to write to the same file multiple times in your program then you will get this error. You can workaround this error by using the other File I/O VIs such as the Write to Spreadsheet File. I am attaching a small example VI that demonstrates using both the Express VIs and the easy level file I/O VIs to write to a file multiple times. Please take a look at this VI. You will noti
ce that using the Express VIs returns and error but using the Read and Write to Spreadsheet File does not.

I hope this helps!
Regards,
Jyoti F.
National Instruments
0 Kudos
Message 2 of 4
(2,865 Views)
Thanks for the help, that's how I ended up getting around the problem. I am still confused why I can't just overwrite the file when I select that option using the Write LabVIEW Measurement file.
0 Kudos
Message 3 of 4
(2,865 Views)
Dear Sdb,

The Read and Write LabVIEW Measurement file VIs are Express VIs and are brand new to LabVIEW. As you have noticed, they have limited functionality because the flags do not reset until the VI starts again. Anytime we encounter a limitation of an Express VI we must replace it with the traditional VIs. However, because these VIs are new and we are constantly improving LabVIEW, I would highly recommend filing a product suggestion at the Product Suggestion Center. The Product Suggestion Center allows you to submit your feedback directly to our developers in R&D.

Regards,
Jyoti
0 Kudos
Message 4 of 4
(2,865 Views)