LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overwriting a file in Labview 8.2

Hi!

I have been browsing tons of same kind of situations, which none point at LV 8.2
I cant seem to find any of those files that they say to use to solve this dilemma.
so, here i go:

I try to write a data array to file. it goes there ok.
When i try to write again, it appends it to the next free line and doesnt overwrite the old data.

What should i do?

Yours Truly,
Tomi Nurminen
0 Kudos
Message 1 of 7
(3,589 Views)

Hi Nallez,

Which function do you want to use? In which format do you want to save your data? Don't you want to append data after each loop or after each run of your vi?

Best regards,

Pelle S
Account Manager
National Instruments Sweden
0 Kudos
Message 2 of 7
(3,576 Views)
Hi Tomi,

there's a function called 'Set File position' (or similar, don't have LV8+ at hand). You can set the position of the next file access (read or write). So just set to 0 to overwrite the file.
Other option: delete the file before writing to it. (You can also check for presence and delete if necessary.)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(3,572 Views)
It's writing a string with tons of Comma Delimiters and EOL's depending on arraysize.

The reason i'm not using Write to spreadsheet file, is because it makes leftover Commas to those lines, which have fewer items than the arrays max size.


0 Kudos
Message 4 of 7
(3,572 Views)
You may want to refer to your file in slightly different manner in order to gain more control of the writing. Please see for example Write to text file.vi.
I've also made a screenshot of that example which I've modified.
 
Does it help?
Pelle S
Account Manager
National Instruments Sweden
Message 5 of 7
(3,542 Views)
Yep i tried that allready, but it didnt fix the problem.
0 Kudos
Message 6 of 7
(3,518 Views)
problem found. thx all for help!
0 Kudos
Message 7 of 7
(3,512 Views)