07-15-2014 11:46 AM
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
Possible reason(s):
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.
Thanks.
Solved! Go to Solution.
07-15-2014 11:48 AM
Is it possible to delete the file first, then save?
07-15-2014 11:57 AM
I tried deleting first but I still get the same error.
07-15-2014 11:59 AM
Is it possible to do a "save as" on the original file, save the template as the correct name, then delete the original file?
07-15-2014 12:01 PM
Try this...
07-15-2014 12:31 PM
Tried both suggestions and I still get the same error.
07-15-2014 12:40 PM
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.
07-15-2014 12:49 PM
Thank you so much crossrulz. That works perfectly. I knew there should be a simple way to do this.