05-18-2013 01:36 AM
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.
05-18-2013 01:45 AM - edited 05-18-2013 01:56 AM
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.
05-18-2013 02:04 AM
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.
05-20-2013 01:06 AM
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.
05-20-2013 03:34 AM
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...