LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a relationship between a menu and a button?

Dear All,
I am trying to make a menu.
I want to make the result like that, clicking the menu as same as I click the button. But not to copy the code of the button's value change event case, Because it will add more variety.
Is there any convenient way?
Thanks.
0 Kudos
Message 1 of 6
(2,689 Views)
Use an event case to detect the menu.
In this event use a Value(signalling) property node of the boolean.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 6
(2,684 Views)

Hi

Just as an extension of Ton´s answer, your event case should handle the two events (menu selection and button val.change) the same way.

You insert a boolean control, and you generate a value change on it when the menu selection is selected.

Then, if you already defined an action for the button, you need just to define another event case handled by your "press button" case.

 

Mitulatbati

Message 3 of 6
(2,680 Views)
Hi,
Thank you for your reply.
Is it necessary to change the mechanical action to switch? Why the latch action can't do the thing?
Thanks again.
0 Kudos
Message 4 of 6
(2,671 Views)
Hi,
Thank you for your reply.
Is it necessary to change the mechanical action to switch? Why the latch action can't do?
Thanks again.
0 Kudos
Message 5 of 6
(2,671 Views)
Hola!
 
I have made an application, which has such a part, exactly the same what you have written. There are two possibilities to run a subvi, one is a menu selection, the other is click on a button. The button in my app. has "switch until press" mechanical action, and it works. With latched mechanical action you can NOT play with the "Value" nad "Val(sgnl)" property node, and not even its local variables. The reason is just some clicks from you. Read the help in LabVIEW for "mechanical action of boolean objects" carefully!
 
But finally, you should create another boolean, next to your button, and use its Val(signaling) property node. I propose to hide it on the front panel, since you use only its property node. Then create an event handler, which handles these both cases. I have no better idea.
 
regards
Mitulatbati
 
Message 6 of 6
(2,642 Views)