i2dx Posted September 24, 2006 Report Share Posted September 24, 2006 Hi Folks, I'm going into production with LV 8.2 - therefore some of my tools (allmost all ...) have to get a little code review. Because I'd like to start them from the "tools" menu, I use the Application.MenuLaunchVI Property of the Application Object to determine, which VI has "called" the Tool. I know, that there is a issue with unsaved VIs and I can accept that, but with LV 8.2 it seems, that the Application.MenuLaunch Property sometimes works, and sometimes not. I can not figure out why? Has anyone an idea, why, and what could be a workaround? thx, CB Download File:post-885-1159118206.llb Quote Link to comment
Yair Posted September 24, 2006 Report Share Posted September 24, 2006 This has something to do with getting the right application instance. You can see an example for how to get the current application instance in a version indepedent manner in the library attached here. Quote Link to comment
i2dx Posted September 25, 2006 Author Report Share Posted September 25, 2006 This has something to do with getting the right application instance.You can see an example for how to get the current application instance in a version indepedent manner in the library attached here. thanks, for the tip! unluckily it did not work. the error 1004 (the VI is not in memory) occurs at the node "App.MenuLaunchVI" in the VI "Get Menu Launch VI Ref". Has anyone an idea, why or how to get the reference to the Menu Launch VI? Obviously there has to be a way (how else could NI start actions from the tools menu on selected VIs ...), but it seems to become difficult to find out how ... thx, CB Download File:post-885-1159171963.zip Download File:post-885-1159171983.zip Quote Link to comment
Ton Plomp Posted September 25, 2006 Report Share Posted September 25, 2006 thanks, for the tip! unluckily it did not work. the error 1004 (the VI is not in memory) occurs at the node "App.MenuLaunchVI" in the VI "Get Menu Launch VI Ref". Has anyone an idea, why or how to get the reference to the Menu Launch VI? Obviously there has to be a way (how else could NI start actions from the tools menu on selected VIs ...), but it seems to become difficult to find out how ... thx, CB If I understand correctly you have missed one wire: In case 3 where you open the VI-reference you have to tell in which application instance this happens. Your VI (Get Menu Launch VI....) runs in the application main instance, the calling VI runs in a project instance.. And i think that the App.MenuLaunchVI property should be controlled by the local (main instance) application instance, or you should read this name outside the while loop. Because the user app instance has no ManuLaunchVI info. Ton Ton Quote Link to comment
i2dx Posted September 25, 2006 Author Report Share Posted September 25, 2006 If I understand correctly you have missed one wire: In case 3 where you open the VI-reference you have to tell in which application instance this happens. Your VI (Get Menu Launch VI....) runs in the application main instance, the calling VI runs in a project instance.. And i think that the App.MenuLaunchVI property should be controlled by the local (main instance) application instance, or you should read this name outside the while loop. Because the user app instance has no ManuLaunchVI info. Ton Ton thanks, that was error. I have attatched the working llb, if someone wants to move the Frontpanel Panes to 0:0 from the tools menu, this little tool may help. cheers, CB Download File:post-885-1159187552.zip Quote Link to comment
Ton Plomp Posted November 20, 2006 Report Share Posted November 20, 2006 hi id2x, found a new way (LV 8 only) App.Menulaunch.app Ton 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.