Out-Parameter of Functions

Top  Previous  Next

 

The following just concerns functions, not function blocks.

 

In a S7 Out-parameter have already got a defined value at calling contrary to the rules of the IEC 1131. Actually they behave like In-Out-parameter. This tempt some programmer into using Out-parameter like In-Out-parameter, for example by not assigning a value to an Out-parameter in many scans and only resetting it sometimes. We think that this practice is very dangerous. Because there is no guarantee that later revisions of a CPU show the same behaviour. The consequence is that a program does not run anymore on a new CPU after a failure of a CPU. You cannot pin the blame on Siemens in such a case: the new CPU does behave according to IEC 1131. Even the transfer of the program to another system that behaves conforming to IEC 1131 takes more time than expected by the misuse of the Out-parameter.

 

That is why in TrySim the Out-parameter do not have a defined value at calling a function regularly. This can lead to the fact that a program that runs on a S7 well will cause problems if it is processed by the TrySim-internally-PLC.

 

For the users of the standard- and professional-version we offer the option to recreate exactly the wrong behaviour of the real S7 in this point.

 

What is said about the Out-parameter on top is also valid for the In-parameter basically. But here there is a clear offence against the regulation of the IEC 1131 in the S7: An In-parameter must not be changeable in that way that the calling block has to calculate with other data after that. But the temptation to assign a new value to an In-parameter in a function is quite little, so that you must expect problems only in special cases. TrySim behaves in this point conforming to IEC 1131.

 

Differing implemented properties

Parameter-updating with functions

 

S7-300 and S7-400 are registered trademarks of the Siemens AG.