IntegratorReal module's Out variable goes to Zero after Cold Restart
Voted best answer
Working as Expected ....
The output of the function block is not "Cold Retain" - it is not retained at all ! The setting of your "Out" variable does not matter - it is cleared when the IntegratorReal function block executes during the startup. The IntegratorReal clears its own output then writes zero to your variable.
To Fix you can try ...
Track := FirstScanAfterAplicationStart();
TrackVal := Out;
Also, it is not necessary to connect every input to variables - you can use fixed values ( or leave blank for defaults) ....
In := MyInput,
Track := FirstScanAfterApplicationStart();
TrackVal := Out,
Reset := MyResetButton,
MaxOut := 1.0E+38,
Out => Out );
Usually IntegratorReal is equipped with additional logic containing external Coldretain variable that is used to recover Integrator value on Cold restart.
Also remember that IntegratorReal's internal precision is limited (let's say 11 digits). It means that after 2 years of accumulation it may stop counting even if input value is higher than zero.
Workaround is in using additional Dint counter , which counts up if IntegratorReal reaches 4 digits that should reset Integrator.