From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to a text file.

That depends on the application and what kind of lock they put on the file.

Message 11 of 13
(270 Views)

@MariusS wrote:

Thank you for all responses. This little app I created is monitoring and recording data 24/7. Every 3 days I stop the app for couple seconds to create and load a new .txt file because is getting too big. Now isn't the case with open files that you cannot copy or move them?


You probably don't want to move it whilst you have an open reference to it in LabVIEW, but there's nothing to stop you closing the reference, generating a new file name (or moving the file) and then starting a new file and passing the (new) reference back to whatever uses it in LabVIEW.

 

You can periodically do this (every day, every 3 days, when the file becomes more than x MB, etc) and that will allow the app to run continuously rather than nearly continuously (assuming this is the only reason you need to stop it).

Close file and open a new fileClose file and open a new file

(note of course that in the example above, I don't actually do any work, the path is not set for the new file, and I don't handle any possible errors etc)


GCentral
Message 12 of 13
(253 Views)

@MariusS wrote:

This little app I created is monitoring and recording data 24/7. Every 3 days I stop the app for couple seconds to create and load a new .txt file because is getting too big. Now isn't the case with open files that you cannot copy or move them?


It's your application. You can (learn to) do whatever you want.

 

If you need to close the file to copy\move it to the network, close the file!

Message 13 of 13
(240 Views)