LabVIEW Formula Node Does Not Save Values From Last Iteration

Updated May 14, 2020

Reported In

Software

  • LabVIEW

Issue Details

I have the following programm code. Since my update to LabVIEW 2019, the output is different.
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

Solution

The behaviour of the Formula node was changed in LabVIEW 2019 to reflect the generel LabVIEW Dataflow.

LabVIEW 2019 and newer
Before each iteration, the output value is initialised 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 IterationInputOutput
000
111
200
311
 
In order to reproduce the "old" behaviour you have to rewrite your code, for example with shift registers.


LabVIEW 2018 and earlier
Before the first iteration of the while loop, the output value is initialised 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 IterationInputOutput
000
111
201
311