Attribute pragmas

Attribute pragmas are used to influence compilation and precompilation.

TwinCAT supports a number of predefined attribute pragmas. In addition, you can use custom pragmas, which you can query by using conditional pragmas before compiling the project.

Attribute pragmas 1:

If you define your own attributes, make sure they are unambiguous. You can achieve this by assigning a prefix to the attribute name, for example.

Attributes are defined in the declaration part. Exception: You can only use attributes in Action or Transition objects if the implementation language of the action or transition is “Structured Text (ST)”. Since actions and transitions do not have a declaration part, you define attributes at the start of the implementation part.