Use under TwinCAT 3
Under TwinCAT 3 (from Build 4020) a delta algorithm is used to save data in the NOVRAM. The algorithm does not save all the variables in the NOVRAM. Instead, it searches for changes (delta function) compared to the previous cycle and only saves variables that have changed.
To use the delta algorithm, a Retain Handler must be created in TwinCAT 3, and the relevant variables must be declared in the PLC with the keyword VAR_RETAIN.
A new feature of this method is that no function blocks have to be used. The Retain Handler saves data in the NOVRAM in the event of a power failure and makes them available again once the power has been restored.