Solution
The behavior of the Formula node was changed in LabVIEW 2019 to reflect the general LabVIEW Dataflow.
LabVIEW 2019 and newerBefore each iteration, the output value is initialized with the standard value.
If the IF condition is met, the value is changed.
If the IF condition is not met, the value stays the standard value.
Provided Code Snippet will produce the following result in LabVIEW 2019 and onwards:
Loop Iteration | Input | Output |
0 | 0 | 0 |
1 | 1 | 1 |
2 | 0 | 0 |
3 | 1 | 1 |
In order to reproduce the "old" behavior, you have to rewrite your code, for example with shift registers.
LabVIEW 2018 and earlierBefore the first iteration of the while loop, the output value is initialized with the standard value for the data type.
Later, the value is only changed, if the IF condition is met.
If the IF condition is not met, the output value from the last iteration is used.
Provided Code Snippet will produce the following result in LabVIEW 2018 and earlier:
Loop Iteration | Input | Output |
0 | 0 | 0 |
1 | 1 | 1 |
2 | 0 | 1 |
3 | 1 | 1 |