03-28-2018 08:20 AM - last edited on 05-20-2024 04:59 PM by Content Cleaner
Normally when I google a LabVIEW error code I don't have too many problems finding information. This one doesn't seem to have much. If fact it's not even listed here:https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/errors/bd-misc-errors.html
Luckily the explain errors comes up with the following:
Error 1508 occurred at an unidentified location
Possible reason(s):
LabVIEW: Cannot change the name or path of a VI that is part of a library in its current state.
So here's how I'm getting this. I have some scripting code. It takes a class and finds a specific vi within it (a template) and then does a save as and then modifies the new vi. Then does a saveall on the owning class. Then loops around and does it again to save a copy as another new name.
The first time everything goes fine. The second time I get error 1508.
I am saving everything on the class and I'm making sure to close the vi reference between calls. The second time through it finds the template vi correctly and the second save as path is valid.
Anyone have any ideas?
Solved! Go to Solution.
03-28-2018 09:47 AM
I Think... (I do not Know for certain) that 1508 is an error attempting to add to a library that is not runable because it needs saving. You need the library save method between calls
and a template vi would be preferable. as in MyBar.VIT not vi
03-28-2018 02:46 PM
I can add a lot of value but at one time Stephen explained that a VI created from VIT is technically not part of a class and can not access private functions because it is not part of the class.
That was ages ago and I have not tried it again since.
Ben
03-28-2018 09:54 PM
Well I am saving the class at the end of each iteration, so that is not the problem.
I tried using a .vit instead and that made no difference.
Anyone have any other ideas?
03-29-2018 08:59 PM
New wrinkle...
At the end of each loop iteration, I am saving the class. If I put a breakpoint right after I do that and then when it stops, select "Save all this project", the unpause the breakpoint, it seems to work for the next iteration. So apparently it requires more than just saving the class... Also the window that shows what is being saved when I click on "Save all this project" disappears so quickly that I can't see what is being saved. Is there a way to make it stick around longer? Or some other way to figure out what needed saved?
Also...
Anyone know how to use scripting to do a save all on the active project? I couldn't find a scripting method to do that.
03-29-2018 09:04 PM
Another datapoint:
I got to the breakpoint, before programmatically before the "save all this class" and hit the abort and then tried to exit LabVIEW. It spit back the following... See below.
Still doesn't enumerate what needed saved though?
03-29-2018 09:19 PM
This made me think that perhaps the ref wasn't good, but I double checked and when I probed it, it appeared to be fine... Here is the vi I'm using to save all on the class (see below). It's from the hidden gems palette. Anyone ever used it before? Any have insight into why it might not save everything? Darren?
It's password protected so I can't delve into it, but it seems it almost has to be the problem. Since if I breakpoint either before or after it and manually "Save all this class" everything seems to work fine. And the ref seems fine....
Anyone have any other ideas? Anyone else ever have problems with that vi?
03-30-2018 03:22 PM
Not sure if you found this already, but this thread some more exposed code that I believe is attempting to replication the functionality of the Save All button.
--
Aaron F.
National Instruments
03-30-2018 03:55 PM
Well I obviously didn't look at the pallettes too closely... If you look at the screenshot I just posted, there is a save all this project vi...
03-30-2018 03:58 PM
Onfortunately that didn't work...
Argh.....