LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In LV6.1, can I get the run-time menu refnum of a VI from the VI Path?

Actually, for any version of LabVIEW, can I get the run-time menu refnum from the VI Path (or the VI reference)?

Thanks!
Enrique
www.vartortech.com
0 Kudos
Message 1 of 8
(3,588 Views)
Moving this question back to the top.
www.vartortech.com
0 Kudos
Message 2 of 8
(3,561 Views)
In LabVIEW 6.1 you can get the "Runtime Menu Path" property of the VI class in VI Server.  Is this not what you need?
 
-D
0 Kudos
Message 3 of 8
(3,556 Views)
How can I get the run-time menubar refnum from the Run-Time Menu path? I am after the refnum.

If I want to modify the run-time menu of a VI (let's call it the main VI) from a subVI, I need to pass the "Current VI's menubar" refnum to the subVI. That's ok. But if I want to modify controls or other things in the front panel of that main VI, I also need the refnum of the VI. It will make sense to me to be able to get the run-time menubar refnum of the main VI from the refnum of the main VI, the same way I can get refnums of all the controls, even decorations, in that main VI.

But I don't know how. Am I missing something?
www.vartortech.com
0 Kudos
Message 4 of 8
(3,546 Views)

Sorry, I misread the original question.  To my knowledge, there is no way to programmatically obtain the menu reference through VI Server.  I think the "Current VI's Menubar" function is the only way to get it, so I suppose you do need to pass it into the subVI from the main VI.

-D

Message 5 of 8
(3,538 Views)
All right. Thanks!

I'll turn my question into a request that will go to the product suggestion. I believe this can improve LabVIEW. I hope it can be done.
www.vartortech.com
0 Kudos
Message 6 of 8
(3,534 Views)

I just thought of a workaround...you could have a Menu Bar Ref indicator on your main VI front panel.  When your VI runs, you could have the Current VI's Menubar function wire the refnum into that indicator.  Then, in your subVI that has the VI reference, you could use VI Server to read the value of that indicator, then cast the value into a refnum wire, then you'd have access to the menubar reference in the subVI without having to pass it in to a subVI terminal.  Would that work?

Oh, another simpler idea would be to simply wire the Menubar reference into a global, and read that global in the subVI.

-D

Message 7 of 8
(3,523 Views)
I though the global variable, but not the other technique. Very interesting, thank you so much.

Hopefully in the future there will be no need for these workaround.
www.vartortech.com
0 Kudos
Message 8 of 8
(3,509 Views)