CIF: supported subset for TwinCAT PLC code generation

The CIF 3 PLC code generator supports a subset of CIF specifications for PLC code generation. The following restrictions apply:

  • Unrestricted events are not supported, as they can always be executed (are always enabled), and would lead to infinitely running PLC code. Detection of unrestricted events however, is incomplete. That is, for some unrestricted the code generation results in an error, while for other unrestricted events code is generated without any warnings or errors. Note that an unrestricted event is not the same as a non-synchronizing event. A non-synchronizing event is unrestricted if it is enabled in all of the locations of the automaton in which it occurs.

  • Specifications without automata are not supported.

  • Initialization predicates outside locations are not supported, except if it can be determined statically that they are trivially true.

  • State invariants in components are not supported, except if it can be determined statically that they are trivially true.

  • State/event exclusion invariants (in components as well as locations) are not supported. To allow state/event exclusion invariants to be used in the input, manually eliminate them first using the Eliminate state/event exclusion invariants CIF to CIF transformation.

  • Discrete variables with multiple initial values (including any) are not supported.

  • External user-defined functions are not supported.

  • Urgent locations are not supported.

  • Initialization predicates in locations that can not be statically evaluated are not supported.

  • State invariants in locations are not supported, except if it can be determined statically that they are trivially true.

  • Automata that do not have exactly one initial location are not supported.

  • Urgent edges are not supported.

  • User-defined functions without parameters are not supported.

  • Internal user-defined functions that contain a multi-assignment that assigns multiple (non-overlapping) parts of a single variable are not supported. For instance, a[0], a[1] := 1, 2 is not supported, as multiple parts (the first and second element) of array a are assigned in a single multi-assignment. This restriction applies only to multi-assignments in functions, not to multi-assignments on edges.

  • Internal user-defined functions that contain a continue statement are not supported.

  • Data types other than bool, int (with or without range), real, enumerations, tuples, and arrays, are not supported. This applies to the data types of variables, parameters of functions, return types of functions, etc.

  • String values are not supported.

  • Cast from int to real and casts that don’t change the type, are supported. All other casts are not supported.

  • Sampling of distributions is not supported.

  • The use of the conjunction and disjunction binary operators on anything other than boolean values is not supported.

  • The use of the equality and inequality binary operators on anything other than boolean, integer, real, or enumeration values is not supported.

  • The use of the addition and subtraction binary operators on anything other than integer or real values is not supported.

  • The use of the element test and subset binary operators is not supported.

  • Projection on anything other than tuples and arrays is not supported. This applies to expressions as well as addressables (the left hand sides of assignments). For arrays, both 0-based indices (counting from the left) as well as negative indices (counting from the right) are supported.

  • Slicing is not supported.

  • Function calls on anything other than standard library functions and internal user-defined functions is not supported.

  • The ceil, del, empty, floor, fmt, pop, round, scale, sign, size, acosh, asinh, atanh, cosh, sinh, and tanh standard library functions are not supported.

  • The distribution standard library functions are not supported.

  • Lists (except for arrays), sets, and dictionaries are not supported.

  • The use of functions as values is not supported. That is, functions may only be used in function calls, and may for instance not be stored in variables.