LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Closing Vi

Solved!
Go to solution

Hi,

 

Just a simple question: Why doesn't this work?

Why.png

 

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

0 Kudos
Message 1 of 8
(2,556 Views)

@ThijsBoeree wrote:

Hi,

 

Just a simple question: Why doesn't this work?

Why.png

 

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

Antoine Chalons

0 Kudos
Message 2 of 8
(2,554 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 8
(2,545 Views)

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

 

0 Kudos
Message 4 of 8
(2,540 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 8
(2,536 Views)
Solution
Accepted by topic author ThijsBoeree

have one to generate a dyn event for the other one.

 

Clipboard01.png


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 6 of 8
(2,534 Views)

@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) Smiley LOLSmiley LOLSmiley LOL

 

I'm tempted to change the quote in my signature lineSmiley Wink

"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"


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 8
(2,514 Views)

@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) Smiley LOLSmiley LOLSmiley LOL

 

I'm tempted to change the quote in my signature lineSmiley Wink

"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.  Smiley Sad


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(2,502 Views)