LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
DanyAllard

Add an API to edit Runtime Menu (.rtm) file

Status: New

We currently have an API to edit it

 

MenuAPI.png  

 

What I propose is to extend it with a couple of new function:

 

Open/Create Menu File : Open/Create Menu File return reference to the menu.

Open_Create_Menu.png

 

Write Menu File: From a reference save the file to disk

WriteMenu.png

 

Close Menu File: Close the reference to the menu file

CloseMenu.png 

 

Dany

LabVIEW ChampionArchitect
7 Comments
Intaris
Proven Zealot

And please make these functions available outside of the event structure......

 

Currently editing of the menu can only be performed within the event structure after activating the menu.

EricC.
Active Participant

Yi

 

For several year, NI ahd a llb for editing RTM file.

It running on LV7- and with a littel modification on LV8

 

It doesn't exist any more on the web site.

 

EricC

Ingénieur d'Application / Développeur LabVIEW Certifié (CLD)
Application Engineer / LabVIEW Certified Developer (CLD)
DanyAllard
Active Participant

It doesn't exist any more on the web site.

 

@EricC : That's bad. 

 

Some one have this LLB in there archive some were? 

LabVIEW ChampionArchitect
X.
Trusted Enthusiast
Trusted Enthusiast

What's the problem with being able to edit contextual menus only in the event structure?

As described in the built-in example discussed here, this is rather natural: you don't need to modify the menu until it is used by the user. The only modification you would have to do, if you wanted to trigger the change by some other prior action, would be to pass a flag/variable into that event case using your favorite approach (global variable, FG, queue, etc). Am I missing something?

David@Work
Member

I like this idea.  I'm wishing I could develop a script VI that creates case frames to support all selectable menu tags.  Unfortunately at this time, I can't find a way to interpret a menu file for the VI that I'm planning as the target of this script (not the executing VI).

 

Please let me know when this feature is available.

 

Thanks,

David

AristosQueue (NI)
NI Employee (retired)

A method exists for saving the VI's current runtime menu to a file:

Untitled.png

Only works on a VI that is reserved for run. So to script a runtime menu file, I believe you should be able to

1) create a blank VI

2) open a strict VI reference to that VI (a strict ref reserves the VI for run and I believe is all that is needed to qualify the VI as "running")

3) modify its menu using the existing menu API

4) and then call this method to save the runtime menu to a file.

 

To edit an existing RTM file, open the VI as described above, set the RTM as its menu, edit as above, and then save it.

 

Does that work? If so, can we close this idea as implemented?

JastrebokELI
Member

Please note that you can also use an RTM of your choice for controls. It needs a hack though.

 

1) Generate the desired swappable menu as if it was your VI menu and save it using Save->Run-Time Menu invoke node on This VI. (e.g.: MyMenu.rtm)

2) Link this RTM to your control or indicator using Advanced->Run-Time Shortcut Menu->Edit.

3) Use Save->Run Time Menu to save different menus under the same name (MyMenu.rtm). This reliably updates RTM of the control/indicator without the need top generate the menu every single time!