03-12-2025 10:34 AM
I have a project with a while loop that houses two event structures (two for better organisation). We have noticed with one event structure that listens to two buttons that during a single application session, we can only run the event once. The events are to load a config file or to save one and we can only do either option during a single application session. After some troubleshooting, we have found that the event structure is getting stuck on the event and not moving forward. We need this to be able to allow for multiple events during a single application session. I've provided a VI snippet of the main project for reference and use. We are still relatively new to LabVIEW, so any help is greatly appreciated.
Solved! Go to Solution.
03-12-2025 10:40 AM
The event structure is probably misplaced. To allow for multiple events, it must be included into a loop.
You did'nt attach any snippet. Since I don't have LV2024, as many other people here, I would not be able to open it, only view as a picture.
03-12-2025 10:42 AM
The snippet didn't attach, here it is.
03-12-2025 10:46 AM
I have both event structures inside a single while loop.
The VI snippet has been sent, it didn't attach properly before and I missed it.
03-12-2025 10:48 AM
Each structure blocks the execution flow until its event is fired. From this picture I don't see any reason to use two structures anyway.
03-12-2025 11:01 AM
Generally speaking, if you want to "go through" an event structure, wire a timeout constant to its Timeout terminal (upper left corner).
The timeout is in ms. If the structure doesn't receive an event trigger within the specified timeout, it releases the execution flow.
03-12-2025 11:06 AM
We tried a timeout, it fired before anything happened but then never again.
03-12-2025 11:07 AM
It sounds like each event structure needs to be in its own loop in order to allow for another to fire again. I'll make the adjustment and see what happens.
03-12-2025 11:16 AM
Event structures are like giant nodes that fire exactly once, be it a timeout or a button click or a user event or whatever. Same as any other VI- if you want it to fire twice, you'll need it in a loop.
If you have two event structures, BOTH must fire before you can move on.
Having two event structures in the same loop is almost always a bad idea, and is almost certainly NOT working the way you want it to. Either combine them or put them in separate loops. If you want to monitor multiple buttons, use separate frames in one event structure, not separate event structures.
03-12-2025 11:20 AM
I had wondered about that. It sounds like best practice is to just combine everything into one event structure inside the single while loop. I'll make that adjustment and see if that fixes the issue.
You all have been MUCH more helpful than NI, the support tech I got just wasted my time.