Jump to content

App.MenuLaunchVI


Recommended Posts

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

Link to comment
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

post-885-1159171935.png?width=400

Download File:post-885-1159171963.zip

Download File:post-885-1159171983.zip

Link to comment
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:

post-2399-1159176227.png?width=400

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

Link to comment
If I understand correctly you have missed one wire:

post-2399-1159176227.png?width=400

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

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.