LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to access the menu of a vi via its vi refnum?

0 Kudos
Message 1 of 11
(4,309 Views)
Hello,

In the menu's functions library it's an option that return vi's menu reference. It's not enought?

See the attached picture.
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 2 of 11
(4,302 Views)
Hi Jorge,

unfortunately it's not enough.
I need to load a vi dynamically by 'open vi reference'. This will provide a vi reference. Next I need to disable some menu entries of the dynamically loaded vi.
Has someone any other ideas?

0 Kudos
Message 3 of 11
(4,294 Views)

What I would do is create a new runtime menu with the items you want disabled. You can create as many different runtime menus as needed. You can then take the reference from the "open vi by reference" and write to the "RT Menu Path" property. See attached pics.

Message Edited by AndrewAlford on 03-27-2007 01:14 PM

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
Download All
0 Kudos
Message 4 of 11
(4,276 Views)
Peet,
 
You can disable and enable menu items dynamically using the VI
Functions->Application Control->Menu->"Set Menu Item Info" (Sets the attributes of a menu item. Unwired attributes remain unchanged)
Previous poster says to create multiple rtm and then dynamically load the correct one.  Not a bad idea, but I prefer my method because you maintain only ONE rtm instead of multiple ones. 
 
 
- crazycliffy
0 Kudos
Message 5 of 11
(4,262 Views)

Crazycliffy: The question was how to get the reference to a dynamically loaded VI's menu in order to use the functions on the palette you mentioned.

Here's my idea, although I didn't test it out so bear with me. I'm not 100% sure it will work.

1. In the dynamically loaded VIs, put a reference to the run time menu and wire this to an indicator so it runs as soon as the VI starts.

2. In the VI doing the loading, load and run the new VI.

3. Use the Control Value:Get[variant] method to get the value of the indicator containing the reference to the run time menu.

4. Use variant to data to convert the variant to a run time menu reference.

If that didn't explain it clearly enough, I can write an example tonight. Just let me know.

Message 6 of 11
(4,255 Views)
Wow. This trick works perfectly.
Thanks a lot.

0 Kudos
Message 7 of 11
(4,247 Views)
I'm glad it worked for you, I wasn't sure how it would turn out.
0 Kudos
Message 8 of 11
(4,225 Views)

Can U pl post the code saved for LV 7.1 ?

I cant understand Marc's explanation completely. Smiley Sad

- Partha ( CLD until Oct 2027 🙂 )
Message 9 of 11
(4,218 Views)
Hello,

the example contains two VIs, called 'Caller.vi' and 'Dynamic.vi'
Dynamic.vi just creates a simple menu for illustration purpose.
Run Caller.vi and toggle the Enable/Disable button. This enables/disables the Menu 1 item of the Dynamic.vi

Download All
0 Kudos
Message 10 of 11
(4,198 Views)