LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement a button function to trigger several buttons

Solved!
Go to solution

Hi All, I have 6 buttons "Read" in front panel, each of them works seperately. In the block diagram, each button is inside an event.

Now if I want to create a new button, that by clicking it, all these 6 buttons can be triggered, how can I do it?

The attached picture shows what I want to do. Thanks for advising!

read all.PNG

0 Kudos
Message 1 of 26
(3,980 Views)

Define user events related to your buttons. Each of your current event cases would be modified to include the user event as well. When your magic button is pressed simply generate the appropriate user events for the other buttons you want to active.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 26
(3,975 Views)

I'm guessing you probably don't have a Producer-Consumer architecture or a Queued State machine, so you're probably actually doing the reading in the event case for the button. I'm also assuming you're using the buttons with the standard mechanical Latch action, which means you can't use the Value (Signaling) property. Otherwise, you could simply have the Value (Signaling) property for the other buttons, and write a True to them. So, your options are:

  • Change the mechanical action of your buttons to "switch". This means you will need to reset them yourself in the event case. It will also mean you will need to initialize their values at the start of your code.
  • Get a better architecture that will allow you to queue up each "event" that you want to do.
  • Create a user event that reads all six values.
0 Kudos
Message 3 of 26
(3,972 Views)
Solution
Accepted by topic author bhl3302

Here is a simple example to show how it is done using the Vlaue(signaling) property node to cause an event for each other button.

 

- tbob

Inventor of the WORM Global
Message 4 of 26
(3,970 Views)

@tbob wrote:

Here is a simple example to show how it is done using the Vlaue(signaling) property node to cause an event for each other button.

 


The value signaling works in the same way irrespective of the input whether it is true or false why is this behaviour?. Can you or anyone please explain any significance behind this?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 26
(3,967 Views)

@P Anand wrote:

@tbob wrote:

Here is a simple example to show how it is done using the Vlaue(signaling) property node to cause an event for each other button.

 


The value signaling works in the same way irrespective of the input whether it is true or false why is this behaviour?. Can you or anyone please explain any significance behind this?


Because you did change the value. It does not verify that the value is actually different, just that a value was written to it.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 26
(3,963 Views)

@P Anand wrote:

@tbob wrote:

Here is a simple example to show how it is done using the Vlaue(signaling) property node to cause an event for each other button.

 


The value signaling works in the same way irrespective of the input whether it is true or false why is this behaviour?. Can you or anyone please explain any significance behind this?


Why would you expect it to work differently? The event case provide the "NewVal" and the "OldVal" to use as a comparison.

0 Kudos
Message 7 of 26
(3,962 Views)

@Mark_Yedinak wrote:

@P Anand wrote:

@tbob wrote:

Here is a simple example to show how it is done using the Vlaue(signaling) property node to cause an event for each other button.

 


The value signaling works in the same way irrespective of the input whether it is true or false why is this behaviour?. Can you or anyone please explain any significance behind this?


Because you did change the value. It does not verify that the value is actually different, just that a value was written to it.


Yes it is not checking the input thats why I am asking why this property is kept like this?. If you take the Re-initialize to default method it doesn't need take an input but here we need to wire the value but changing that doesn't make any difference.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 26
(3,959 Views)

@smercurio_fc wrote:

@P Anand wrote:

@tbob wrote:

Here is a simple example to show how it is done using the Vlaue(signaling) property node to cause an event for each other button.

 


The value signaling works in the same way irrespective of the input whether it is true or false why is this behaviour?. Can you or anyone please explain any significance behind this?


Why would you expect it to work differently? The event case provide the "NewVal" and the "OldVal" to use as a comparison.


Yes I got it but am just trying to understand why an input required for that. Does my question make sense?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 26
(3,957 Views)

To be honest, not really. The function is to write a value and generate a signaling event. It's not "only write the value if it changed".

Message 10 of 26
(3,953 Views)