Programming
This section of PLC programming conventions covers the following topics.
Also note the option to check programming conventions using TE1200 PLC Static Analysis.
General
Loops and conditions
Error Codes
Readability, maintainability
Libraries
Library development
Use of libraries
- Use of libraries [++]
- Version check [++]
- Fix library versions [+]
DUTs
Implementation of DUTs
Use of DUTs
POUs
Implementation of functions, methods, actions
- No "call by value" of large parameters in functions/methods [++]
- Do not declare large variables in functions/methods [++]
- Do not use actions [+]
- Use all parameters of a function/method internally [+]
- Assign return value of a function/method only in one place [+]
- Restrict access to methods as much as possible [+]
- Grouping of parameters as structure [+]
Use of functions, methods
Implementation of function blocks
Use of function blocks
Variables
General
Variable encapsulation
Arrays
Pointers, references, interfaces
Allocated variables
Global variables
Strings
Runtime behavior
General
Dynamic memory
Multiple tasks