LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notifier breaks normal data flow behaviour

Solved!
Go to solution

This is another one of these Notifier questions... I would appreciate if someone could explain to me what's wrong with the attached VI (LV2012).

 

When moving the slider, I get different readings along a single wire which is just data flow sync'd with the output of a notifier. In particular, there is one "normal" notifier that feeds a loop that operates as expected. The "spooky" notifier is used to trigger readout of a control value indirectly. If the notification output is wired to the sequence structure, it produces non-equal results in out1 and out2 (or probes on that wire). If this wire is removed, it works as expected. 

 

The wire from Slider to out1 and out2 seems to keep 2 different values without any obvious data flow condition or timing.

 

Thank you

Dirk

0 Kudos
Message 1 of 5
(2,746 Views)

Hmm, I agree. That does not look right.

 

NO, it looks OK!

0 Kudos
Message 2 of 5
(2,741 Views)
Solution
Accepted by topic author Dirk@LV

Race condition.

 

In your second loop, the slider is being read before the Notifier is sent.  So it will actually always be 1 iteration behind.  By wiring up that boolean to the sequence structure, you are stating that the indicator cannot be updated until a notification is received.  And since that slider value was read before the notifier was recieved, the indicator will get the "old" value.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,738 Views)

Yes, I was a bit too fast. The out2 will be written once more in the next iteration when it is waiting again for the notifier.

0 Kudos
Message 4 of 5
(2,732 Views)

Ouch! That was simple. I couldn't see the obvious.

 

Thanks to both of you.

 

D.

0 Kudos
Message 5 of 5
(2,698 Views)