GregFreeman Posted June 20, 2012 Report Share Posted June 20, 2012 (edited) I have a tool I'm creating and it searches the active project for all VIs recursively. I have found if I try to use Open VI Reference to an unsaved VI it fails (I am wiring up just the VI name as a string). It gives me error 1004, VI not in memory. However, if I go to that specific project and create a new VI and do open VI Reference with "Untitled x" wired as a string, it opens the reference fine. Does the tools menu somehow run in a different context where it can't open a reference to an unsaved VI? Is there a way to make this work? I should add, there are no problems when it's saved to disk and wired up as a path (somewhat obviously). Edited June 20, 2012 by for(imstuck) Quote Link to comment
Jon Kokott Posted June 20, 2012 Report Share Posted June 20, 2012 Is the application reference of the open VI reference VI wired with the same application reference it exists in? Quote Link to comment
GregFreeman Posted June 20, 2012 Author Report Share Posted June 20, 2012 The application reference I have wired up is the one returned from "menu launch VI information.vi" Quote Link to comment
GregFreeman Posted June 20, 2012 Author Report Share Posted June 20, 2012 (edited) Here is an example. Unzip this to <LabVIEW>/projects. Create a new project and a new VI. You will need to add a comment on that new, unsaved, VIs block diagram that says "test" (omit the quotes). Then run my tool. It should find the VI but when it tries to open a reference to it, it returns an error. Test Issues Folder.zip Edited June 20, 2012 by for(imstuck) Quote Link to comment
Jon Kokott Posted June 20, 2012 Report Share Posted June 20, 2012 (edited) Instead of using the "menu launch information.vi" (which I'm totally unfamiliar with/do not have) try using an application (read) property node -> App.MenuLaunchApp to get the calling application reference. I also use App.MenuLaunchVI to get the name of the VI in memory, but you can only open that vi in memory when wiring the application reference from teh app.menulaunchapp. I think that the property node I use is not available by browsing. ok here it is GetActivationVI.vi Edited June 20, 2012 by Jon Kokott Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.