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.
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.
04-21-2010 05:23 PM
I get this error when I am writing to a CSV file: I record data there continuously... well I have programmed that it stores about 100 points in the memory and writes every 100 points.
When I open the recorded file, for example in notepad to preview it, Labview returns the error "File is already open" and hence it cannot write.
Isnt this weird? Arent you just caching the file info when opening? How do I solve it?
I am using the 'write to spreadsheet' VI.
Thanks
Solved! Go to Solution.
04-21-2010 05:45 PM
No it isn't weird. Notepad has the file opened. How can Labview open it for writing? Can't be done. Close Notepad before running Labview. When you want to view the file, pause Labview, open the file with Notepad, then close Notepad before resuming Labview. A big pain!
The workaround is to create code in labview to read the file and display the contents in an indicator. Then you can see the new writings on the fly.
04-21-2010 11:03 PM
04-22-2010 03:09 AM
smercurio_fc wrote:
An alternative is to use Notepad++. It caches the file it reads, so you can still write to it. If you switch application focus from Notepad++ and then back into Notepad++ then Notepad++ will detect the file has been updated and asks if you want to reload it.
... Or just do the old fashioned thing, copy the file you want to check, open and view the copy and continue to write to the original.
I haven't had problems with this method yet.
Funny how this error never appears for me in my config file code. (Maybe beacuse I have all the file data cached in a FGV I can just write all the data to the file again whether it is opened by notepad or not!)
James
04-22-2010 10:41 AM
smercurio_fc wrote:
An alternative is to use Notepad++.
What is Notepad++? Does it come with some version of Windows?
04-22-2010 10:46 AM
tbob wrote:smercurio_fc wrote:
An alternative is to use Notepad++.
What is Notepad++? Does it come with some version of Windows?
No, it doesn't. It's a free editor designed to be a replacement for Notepad.
04-22-2010 11:41 AM
04-23-2010 02:13 PM
Guys, thanks for the replies.
As a matter of fact I dont WANT to see the file when writing. But I'm building a commercial app and it will probably happen once or twice when users will try to open a file that is being written to.
So if I cant avoid the error when opening, maybe I can prevent the user from opening the file by setting permissions? I will try this and report. Other suggestions are welcome.
Felix
04-23-2010 02:31 PM
04-23-2010 03:21 PM