01-12-2015 08:17 AM
What's wrong with having it all in a single event structure? Typically, event structures are just for user value changes and some other GUI events that occur not often. So having a timeout case that is sometimes enabled is a common thing (at least in my designs).
What is your actual goal here with the second loop?
01-12-2015 08:20 AM
Again, I want to switch on and off the timeout event.
Read the link in the first post to understand why.
At certain times, it makes no sense to run the timeout so I want to disable it.
I dropped the idea of using the timeout event entirely and went for a simple loop. Works fine.
Busy waiting for the win.
01-12-2015 08:21 AM
01-12-2015 08:27 AM
@Dennis_Knutson wrote:
Does the example actually use two different event structures?
The answer to that is no.
01-12-2015 08:31 AM
01-12-2015 08:33 AM
My point was the handshake between parallel loops/event structures. Especially when you handle the timeout event. This latter may break the communication flow under certain circumstances, that's to avoid.
Reg/unreg events is really useful, but what you're seemingly trying to do is out of the scope of the tutorial.
Create a queue, or a user event (like nathand's highly acceptable suggestion :)) so that you have a user-defined mechanism whose lifecyle is handled more smoothly.
Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.
01-12-2015 08:55 AM - edited 01-12-2015 08:57 AM
I had the timeout in the other loop previously.
I wanted to change it to run in parallel to the other loop and only occasionally.
The question wasn't if the event is necessary, but whether it's necessary to change a lot of code and the tutorial seemed to answer that question with no.
01-12-2015 09:03 AM
Heck,
Max's code in message 4 is so close to working if he understood dataflow in LabVIEW a bit better. If he added an event case for the "NUmerisch" indicator for Value Change, then instead of righting to a local variable of the indicator used a Value(signalling) property node.
Then it will work properly in the design architecture he really wants to use and doesn't use User Events like Nathan's example.
I would use Nathan's example if it was my project.