These are two examples of functions to demonstrate the nature of the problem. (It should only have 2 images and not 3, can you remove the second one which is the same as the first?)
The first example represents 2 quick modifications of a variable exchanged with a PLC (it is only the Flexy which modifies the value). Before exiting the first function, even after
VarDINT@ = $Tempo% the 2 values are not equal (110/111). It’s strange ???.
On the second function call, the result is always the same. We have lost the increment of 1 of the first call of the function.
To correct the situation (the second example), I had to wait before exiting the function for the 2 values to be equal using a wait loop before continuing. It is strange that after the instruction
VarDINT@ = $Tempo% that the 2 values are not equal, this is the reason for using
IF and GOTO.
I hope I explained my problem better.