LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

some questions about Event Struture

Solved!
Go to solution

Please see Test1.vi,when i click on the button 'OK',the value of 'display1' is the same as 'source',but the value of 'display2' is the 'source' i enterd last time.For example,if i enter 1 and 2 into 'source' before and after for two times,when i click 'OK' the second time,'display1' is 2 but 'display2' is 1.

 

I want to know why this happen.Thanks!!

0 Kudos
Message 1 of 6
(3,010 Views)

Hi guigui,

 

it's all dictated by THINK DATAFLOW!

 

1. The "source" control is read before entering the event structure.

2. The "source" local variable is read when the event is executed.

1 & 2 don't occur at the very same time: THINK DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,000 Views)

First,thank you very much!

I am not so clear about DataFlow,where can i learn more about DataFlow in Labview?

0 Kudos
Message 3 of 6
(2,994 Views)
Solution
Accepted by topic author guigui004

Hi guigui,

 

in the LabVIEW help.

Or in appnotes from NI like this

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,988 Views)

Thank you!

0 Kudos
Message 5 of 6
(2,921 Views)
Solution
Accepted by topic author guigui004

This is my favorite description of LabVIEW and dataflow.

 

This is THE STATEMENT to take away from that little discussion: "Remember that a node executes only when data is available at all of its input terminals and supplies data to the output terminals only when the node finishes execution."

 

If you take this one sentence as literally as possible, you won't have problems figuring out how your program executes.  And if you still can't, that probably means you have a race condition.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 6
(2,901 Views)