10-12-2020 08:20 AM
I am having a hard time understanding the difference between adding value change event cases to an event structure and adding more than one dynamic event to the ''Register for Events'' function.
When do I need to add one more than one dynamic event to the ''Register for Events'' exactly?
I am having a program where I have two event handling loops and their corresponding message handling loops, would using more than one dynamic event let me give up the other EHL and have just one for the two MHLs I have?
Solved! Go to Solution.
10-12-2020 09:33 AM
@Amr95 wrote:
I am having a program where I have two event handling loops and their corresponding message handling loops, would using more than one dynamic event let me give up the other EHL and have just one for the two MHLs I have?
Assuming your event cases are fast enough to keep up with both messages, I see no reason you can't register for more event and handle it in a single loop. This can greatly simplify your code.
10-12-2020 10:46 AM
Let's say you have two buttons on the front panel, which are handled by an event structure.
Since both buttons should trigger different actions, the structure as one case for each of them.
Now, a "user event" is kind of a queue with data type, which can be filled from somewhere in the code. (So, not at all "user"!)
There may be two or more events of same data type, but different desired action (like the two buttons), or even user events of different data types. Therefore, register for several user events, and have one case for each in the event structure.
Two hints:
Something like this is typical: