There is clearly a confusion that both the Original Poster and, perhaps, JensG69, have about Latched Booleans and Event Structures. In addition, the Principle of Data Flow appears to have been neglected!
I offer the following "Teaching Example" -- I created a Cluster of three Latched-When-Released Boolean Controls that "look like" LED Indicators (this is perfectly legal in LabVIEW, and makes them stand out) and made a TypeDef out of it. I then created two Demo VIs with a two-frame sequence (so I can "know" the order of operations). In the first, I write the Control into an Indicator, followed by creating a Value Change Event and saving the NewVal in a second indicator. In the second, I reverse the order, doing the Value Change first and reading the Control second.
Here is the starting Front Panel, after I deliberately "turned on" the first Latch before running the two Demos (both Front Panels look the same) (by default, all the Latches are off). Next to it is the Block Diagram of Latch Order 1.
So here how the demo works -- before you run it, Control 1 is on. There are three parts to this "quiz":
- When you push the Run button, what happens to Latches, Latches 1, and Latches 2?
- When you push and hold Latches Button #2, what happens to Latches, Latches 1, and Latches 2?
- When you release Latches Button #2, what happens to Latches, Latches 1, and Latches 2?
Don't fret that you will probably get this wrong -- it involves some fairly subtle points (it is possible to make it even more difficult, but let's not go there).
So here is the second Demo's Block Diagram -- it's Demo 1 with the order of the Frames reversed:
Same setup, same three questions. This, I hope, you get right.
Final quiz -- this is the Code that JensG69 posted:
Is this more like Demo 1 or Demo 2? If you answered "Demo 1", you are wrong. If you answered "Demo 2", you are also wrong. If you answered "Using the Principle of Data Flow, you cannot answer the question", then you got the right answer. And that was the point that Blokk was making.
Bob "Long-Winded" Schor