LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event-structure

Solved!
Go to solution

@Dennis_Knutson wrote:

@P Anand wrote:

There will not be any problem if you have two event structures in two frames of stacked sequence because the frame 2 execution shows that there is nothing to do with frame 1 anymore so not a problem you can have. But its always easy to have only a single event structure or if you want it anyhow then make it inside a sub vi so for anyone who looks at the code will be clear to understand the way the code executes.



Not at all true! Having events in two separate sequences does nothing to change the fact that both event structures will always capture events. This is a basic understanding of event structures. Read the help on event structures - especially the 'caveats and recomendations for event structures'.


No its partially true. Even you can play with the 1st event controls but if you try accessing the control which is assigned to event 2 it hampers the code thats why I have suggested the user to use it inside a sub vi. I have tried a bench mark of the code check it.

 

Event Structure_Benchmark.png

 

 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 11 of 13
(472 Views)
Solution
Accepted by FabioBone

@FabioBone wrote:

I've read the issue before the post I wrote.

It affirm that two event-structures in the same while loop could hang the panel, but it happens because the two structures are executed in the same time. In the case that I propose the stacked sequence could prevent the concurrent execution of the two event-structures.

Do you agree? Why the timeout event is fired continuosly in the first event-structure?


 

If you were using dynamic events you could control when the events are registered.

 

With normal event structures the event are registered (made active and can start be fired) when the VI starts.

 

YOu can NOT control the registration by where the appear in your code.

 

If the VI is running (regardless of the seq frame it si in) the events are registered. period.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 12 of 13
(471 Views)

OK, now I've understand. The problem was that I can see only the first event-structure to fire timeout and I've never reach the breakpoint at the very beginning of the loop containing the second event-structure.  I think taht the debug problem is a matter of timing. The timeouts are too quickly and I see only those. Is it right? Or should I see also the second structure be executed? 

0 Kudos
Message 13 of 13
(467 Views)