On analysing the semantics of IEC61131-3 ST and IL applications - Mário de Sousa (2013)
The IEC 61508 standard recognizes the programming languages defined in IEC 61131-3 as being appropriate for safety-related applications, and suggests the use of static analysis techniques to find errors in the source code. In this context, we have added a semantic verification stage to the MatIEC compiler - an open source ST, IL and SFC code translator to ANSI C. In so doing, we have identified several issues related to the definition of the semantics of the IL and ST programming languages, as well as with the data type model defined in IEC 61131-3. Most of the issues are related to undefined semantics, which may result in applications generating distinct results, depending on the platform on which they are executed. In this paper we describe some of the issues we uncovered, explain the options we took, and suggest how the IEC 61131-3 standard could be made more explicit.