LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple events structures for same control

Hi,

 

I would like to use a same blinking button into 2 event structures seperately.

 

Please see my VI, after the first event is done, the second event is not wait for user to press the button, and it is auto triggered.

 

How to solve that? Is there any way to reset the event?

 

Thanks.

0 Kudos
Message 1 of 5
(2,967 Views)

Event structures do not wait for dataflow, they always liten for events and both event structures will queue up the same event at the first time the button is pressed. The second event strucure simply must wait until it is able to execute. It can only do that when all earlier sequence frames have completed.

 

Use one while loop containing one event structure and keep track if the state.

0 Kudos
Message 2 of 5
(2,964 Views)

It is also not clear what you are trying to do with the blinking. In your code, the LED will blink basically always. (you don't use the timeout event).

 

In the first frame, blinking is enabled. Nothing happens in the second frame until the start event occurs. At this time blinking gets disable for about a nanosecond and gets immediately enabled again in the third frame. Even if the second eveng would not execute, you'll never see a difference. So what's the point?

 

Here's a quick draft where each press of the start button toggles between blinking and not blinking. Maybe it can give you some ideas.

0 Kudos
Message 3 of 5
(2,957 Views)

I have created a sequencer can run the multiple devices testing. To avoid operator get confused if all the devices' testing prompt out the sub window for user to interact with, I use the blinking button for user to press first before the sub window prompt out.

 

Currently Im using the while loop to wait the blinking button to be pressed, instead of event loop. Actually there is no any issue for the functional, just it looks like while loop make more burdens to my PC's processor.

 

You can take a look for my VI, just start from 2x2.vi. Do you think event loop is applicable in my blinking button in this case?

 

Thanks.

0 Kudos
Message 4 of 5
(2,906 Views)

Your 2x2 code is very questionable in several places:

You create an array of 4 subpanel references, then take a 5 element subset of it. Why? The math does not add up.

Why do you have a timeout event that is not even used?

Since exit is a latch action boolean, "reinit to default" makes no sense at all. Delete it!

 

Sorry, I cannot analyze the sequencer VI because my laptop screen is too small to efficiently look at the diagram. Still, I see way too many sequences, local variables, and property nodes scattered everywhere. Why are all terminal disconnected? I also don't like the way you are trapping interactive loops inside event frames.  Looks like a nightmare.

 

Maybe I can look at it tomorrow. No guarantees...

0 Kudos
Message 5 of 5
(2,889 Views)