LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Front Panel button executing a menu item

Hello, I'm trying to set up my front panel to execute a menu item through a boolean object.  Specifically, I want a boolean button to perform the Edit -> Make Current Values Default function.  Is there a way to perform menu items programatically?
0 Kudos
Message 1 of 7
(3,490 Views)

In the value change event for the Boolean, you just need to drop an Invoke Node, set it to VI Class, and select the method Make Current Values Default. Note though, that you cannot use this if you make your VI into an executable.

Message Edited by Dennis Knutson on 12-14-2006 11:44 AM

0 Kudos
Message 2 of 7
(3,482 Views)
Menu items can be performed programatically by enabling the 'Run-time menu for the control and handling it  using an even structure or using the vi in Menu Pallete. But I really doubt whether there is a method to 'Make current value default', if that is the menu action you are looking for .
 
Kallis
BR
0 Kudos
Message 3 of 7
(3,474 Views)
Menu items can be performed programatically by enabling the 'Run-time menu for the control and handling it  using an even structure or using the vi in Menu Pallete. But I really doubt whether there is a method to 'Make current value default', if that is the menu action you are looking for .
 
Kallis
BR
0 Kudos
Message 4 of 7
(3,475 Views)
Darn, because the VI is being made into an executable.  Is there any other way to programatically do this?  I don't want to have the menu visible at the top of the VI, so I really would like a way to make all the values in the dialog boxes the default values without having the using select it from the menu.
0 Kudos
Message 5 of 7
(3,472 Views)
'Make current Value Default' invoke node, that Dennis pointed out, will set default values of all the controls in the front panel. So this will not work if you want to just set the default value of an individual control.
 
Kallis
BR
0 Kudos
Message 6 of 7
(3,466 Views)
The menu item won't work either in an executable. The problem is that in order to save new defaults, you would have to be able to modify the exe file and that is something that is just not allowed. There have been numerous postings on this subject and the only thing you can do is to save the current values to some sort of file and then when the program is opened, read that file and set the controls using a local variable or property node. The external file can be either an ini or xml file. There are a couple of OpenG functions that make it all pretty simple. Download the VI Package Manager.
0 Kudos
Message 7 of 7
(3,462 Views)