Section 3.2.2 and 3.2.3
"Temporary tags are undefined when called in non-optimized blocks. In
optimized blocks, the values are always preset to the default value (S7-1500
and S7-1200 Firmware V4). Thus, the resulting behavior is not accidental but
reproducible. "
I mean, that temporary memory is available after exiting the function and if in the next called block there is no assignement and the variable is declared in the table and used in the program, a strange things can happen.
There may be problems of this type when several programmers are working on the project, especially young and unexperienced.
Something will be copied, not be assigned and he is supprised that it does not work.
Clearing temp after invoking the function eliminates this problem.
Since I use it I dont have problems with that.
Maybe it is wrong or maybe not, but that is how I do it. And it works
Clearing the temp area may be giving others the impression that it is ok to use temp variables without initialising them. What makes initialising them to zero any better than any other value?
Is there need of zeroing after all, if you don't initialize temps anywhere on block?
You can only use temp data after some logic is updated temps before inside your block.
And if you read temp data before you put "new" data on block to them, them temp data is = 0 (zeroing) or data from elsewhere of program (on both situations it is useless/wrong data)
Zeroing temp maybe helps on online edits of strange things to happen situations, but it certainly don't repair coding errors of reading from wrong variables
Clearing the temp area may be giving others the impression that it is ok to use temp variables without initialising them. What makes initialising them to zero any better than any other value?