I am working on a VI scripting application. I want to be able to overwrite an existing VI with a new VI created from a template (so I want to be able to modify the template/the scripting source and regenerate the file). I get the following error when I save the vi:
"Error 1357 occurred at Invoke Node in Generate VI from template - overwrite.vi
LabVIEW: A LabVIEW file from that path already exists in memory, or exists within a project library already in memory.
Method Name: Save:Instrument"
I can open and modify the existing VI using scripting, and I tried opening the VI, and then copying and pasting the source code, but it is very difficult to get everything synced up properly when what I really want is a straight overwrite. I have attached the example project I have been working with. "Generate VI from template - overwrite.vi" in the Script Project directory is what I started with. Running that vi gives the error.
It may not be possible to do what I want so I would also welcome possible alternative solutions.
Solved! Go to Solution.
Is it possible to delete the file first, then save?
Is it possible to do a "save as" on the original file, save the template as the correct name, then delete the original file?
Your problem is that you are trying to overwrite a VI that is in the class. And you can't edit anything in the class because it is open when you open the template. What you need to do is save your Generated.vi to some temporary location, close it, and then use Move File to overwrite the "old" file.