Jump to content

Read Run Time Menu Selection of another running VI


badwolf

Recommended Posts

Hi All!

I attached here an example of how to read Run Time Menu Selection of another running VI. I can't believe that this is so complicated. :headbang: There should be a simpler way to do it or not :):) ?

Comments would be welcome

Bye Badwolf

Make run Control.vi , read menu status with Read.vi , change control.rtm as needed

Download File:post-1101-1127820588.zip

Link to comment

Hi Badwolf:

You're right, it doesn't have to be quite that complicated.

One of many simpler ways to do this is shown below.

In the example below, I use a global, which is considered bad form in general,:thumbdown: but works easily for the case you've shown where the two vi's are not directly linked by one being the sub-vi of another, or by being sub-vi's of a common calling vi.

A somewhat better approach would be to use a "LabView 2 style global"-- see past discussion of same in other threads in this forum. (Even if you choose to use the global as shown in my example, read the LV 2 global thread to understand what the risks involved are :!: )

Even better would be to have the vi's linked by one calling the other, or by both being called by a main vi, and then simply wiring the menubar reference out from the vi with the menu and into the vi that manipulates it, :thumbup: but perhaps you can't do that because of other logical requirements of how your vi's need to operate.

post-1144-1127825050.png?width=400

Hope I've been a little help, and best regards, Louis

Link to comment
Hmmm, nice one..

Although I haven't had the need for it yet, I'd say for sake of completeness there should be a VI property Runtime-Menu reference.

Edit: I entered a product suggestion for this on NI's website.

Hi jeffreyhabets!

I think the property you mentioned is called Run-Time Menu Path. I think it doesn't help me in this.

Thank for interest.

Best regards, Badwolf

:beer:

Link to comment
Hi jeffreyhabets!

I think the property you mentioned is called Run-Time Menu Path. I think it doesn't help me in this.

Thank for interest.

Best regards, Badwolf

:beer:

I think you got me wrong. :P The 'property' I mentioned doesn't exist (yet). What I ment to say was that it should exist. Indeed the Run-Time Menu Path is not of use for what you want.

Link to comment
  • 2 months later...
I attached here an example of how to read Run Time Menu Selection of another running VI. I can't believe that this is so complicated. :headbang: There should be a simpler way to do it or not :):) ?

Comments would be welcome

First: TYFPT !!! (Thank You For Posting This) Pronounced like a cartoon character sticking their tongue out, say, Opus from Bloom County...

Okay, think about it, it really wasn't that bad, and if you take your Read.vi and cut out the loop, feed in the VI name, you now have a simple subVI that takes in a VI name and returns a menu ref, providing you have added in that little snippet of code to the called VI. Not perfectly elegant, but as hacks go, this is really pretty painless now.

Now you have it, and so do we. :worship: It couldn't have been that painful to write.

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.