LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic listing of ALL run-time menu items for VI?

Don't see a property node (or invoke node either) to obtain a list of all run-time menu items for a custom run-time menu.  I would think this one would have been developed after all these years.  Am I missing something or is there a reasonably easy way to programmatically get this?  The closest I can come to this is by making an array of top level menu item tags, and reading their submenu item tags 'recursively' while building a string array of items.  If I go to this trouble, I almost might as well just list them out manually in a string array.

Sincerely,

Don
0 Kudos
Message 1 of 10
(3,476 Views)
Hi Don,
some day I made this VI I attached. It handles the recursive things and writes the Menu-Tags into a string. You can adapt it to your needs.
You have to load every rtm-file by hand, but this should be OK.
Greets, Dave

Message Edited by daveTW on 09-05-2006 01:09 PM

Greets, Dave
0 Kudos
Message 2 of 10
(3,458 Views)
hi dave,

can U pls repost Ur llb saved for LV7.1 ?
I dont have LV8 installed in my PC.

Regards & Thanks,
Partha.
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 3 of 10
(3,444 Views)

Looks sweet.....does not like my run-time menu though (says it cannot open it).  I'm using LV8.2.  Maybe worth a try for you so I am attaching.  Change the extension from .vi to .rtm (for some reason, this forum will not accept .rtm files as attachments).

 

Sincerely,

 

Don

0 Kudos
Message 4 of 10
(3,428 Views)

Actually, I did not look at your diagram in detail but your code may actually have corrupted the .rtm file.  Because I had the same experience with another menu.  So make sure you have a back of your menu before playing with this.

Sincerely,

 

Don

0 Kudos
Message 5 of 10
(3,421 Views)
Hi Don,
I think, the text on the front-panel is quite a bit unclear. It means, before running the VI, you should open the menu-editor (with Edit->Runtime Menu...), then open the rtm-file (File->Open...), then close the menu-editor and confirm to change the runtime menu of the VI to the one you selected.
After this you can run the VI. It opens a "Save Textfile to..."- dialog to write the Menu- Items to a text- file. You can abort it if you only want to read it in the string indicator.
And it should be no problem for you to exchange the german string- snippets with one in the language you prefer.

@ Partha: As you asked me, I saved it in Version 7.1.

Greetings, Dave
Greets, Dave
Message 6 of 10
(3,400 Views)
Oh, and now I saw, what rtm- file you sent me. It is the text-file that describes the menu- hierarchy and you overwrote your original rtm- file. That's why  the Menu-Editor can't load this RTM-File.

Btw. I use the TotalCommander for filemanagement, not the windows explorer. One of its "never want to miss again"- features is the fast file-viewer which shows the content of a file as a text or as hexdump. This often gives a good impression of the type of file.

Message Edited by daveTW on 09-06-2006 02:02 PM

Greets, Dave
0 Kudos
Message 7 of 10
(3,399 Views)
I started to realize what happened last nite when I thought about it more and I realized it must have overwritten the original .rtm.  I was going to then post the original .rtm (not the overwritten one that I had posted earlier).  I had also tried with another .rtm file yesterday and the same thing must have happened. But I tried again this morning.
 
I loaded the .rtm menu per your front panel instructions and got the attached message (.png file); I said 'OK' and then located a test.rtm file that I created to do a test, and this worked.  I expect the message shows because the code saves default information from the last try.  Anyhow, I think I see how this works and it would seem to certainly be adaptable to total programmatic capability by placing into a VI already having a custom run-time menu.  Very good. 
 
I would still think LabVIEW should have the capability by first opening a reference to the VI and then obtaining a list of all the items via simple property node.
 
Thanks,
 
Don
0 Kudos
Message 8 of 10
(3,391 Views)
ps. Actually, I should have said, I "tried" to load the .rtm file and that message came up.
0 Kudos
Message 9 of 10
(3,388 Views)
Here is how I simply modified your code for my application - I needed the heirarchy just to search for items having a certain phrase and made a subVI out of it. Works great ......  Don
0 Kudos
Message 10 of 10
(3,302 Views)