02-19-2013 02:13 AM
Hi,
Just a simple question: Why doesn't this work?
With one while loop it works perfectly, with two it doesn't? Why? I mean both event structures have there own instance, and why can't you control two seperate event structures with one command?
Best regards,
Thijs
Solved! Go to Solution.
02-19-2013 02:17 AM
@ThijsBoeree wrote:
Hi,
Just a simple question: Why doesn't this work?
With one while loop it works perfectly, with two it doesn't? Why? I mean both event structures have there own instance, and why can't you control two seperate event structures with one command?
Best regards,
Thijs
No, you shouldn't be trying to capture the same event with more than 1 event structure, I suggest you read this : http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/caveatsrecmndtnsevnts/
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-19-2013 02:40 AM - edited 02-19-2013 02:41 AM
You have to dig a little in the caveats to find the source of the "hang":
As with notify events, you can configure any number of Event structures to
respond to the same filter event on a specific object. However, LabVIEW sends
filter events sequentially to each Event structure configured for the event. The
order in which LabVIEW sends the event to each Event structure depends on the
order in which the events were registered. Each Event structure must
complete its event case for the event before LabVIEW can notify the next Event
structure. If an Event structure case changes any of the event data, LabVIEW
passes the changed data to subsequent Event structures in the chain. If an Event
structure in the chain discards the event, LabVIEW does not pass the event to
any Event structures remaining in the chain. LabVIEW completes processing the
user action which triggered the event only after all configured Event structures
handle the event without discarding it.
So never hook up more than one event structure to the same event source except you KNOW EXACTLY what you are doing. Document this well, otherwise developers inheriting your code will want to kill you 😉
Norbert
02-19-2013 02:53 AM
So how would you solve this? How to close more than one while loop, with the panel close event, with two event structures...?
regards,
Thijs
02-19-2013 02:57 AM - edited 02-19-2013 03:03 AM
Dont discard the event. 🙂 If you use Panel Close instead of Panel Close? - event all structures should react to the action. The Panel Close? is for checking and possibly discarding the event to prevent closure, is that really what you want?
/Y
02-19-2013 02:58 AM
have one to generate a dyn event for the other one.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-19-2013 03:33 AM - edited 02-19-2013 03:40 AM
@Norbert_B wrote:
So never hook up more than one event structure to the same event source except you KNOW EXACTLY what you are doing. Document this well, otherwise developers inheriting your code will want to kill you 😉
Norbert
That professional tip should make it into the help file (in several places)
I'm tempted to change the quote in my signature line
"Document this well, otherwise developers inheriting your code will want to kill you" - Norbert
A very unique coincidence considering "Juliane" is commonly "St. Julian of Norbert"
02-19-2013 04:36 AM
@JÞB wrote:
@Norbert_B wrote:
So never hook up more than one event structure to the same event source except you KNOW EXACTLY what you are doing. Document this well, otherwise developers inheriting your code will want to kill you 😉
Norbert
That professional tip should make it into the help file (in several places)
I'm tempted to change the quote in my signature line
"Document this well, otherwise developers inheriting your code will want to kill you" - Norbert
A very unique coincidence considering "Juliane" is commonly "St. Julian of Norbert"
And just to further illustrate that the world runs on serendipity Is it coincidence or cause and effect? The code is poorly documented. The original author is no longer with us.