ST Style guide - References - SIMATIC AX - Support documentation - ST Style Guide, Cheat sheet

Structured Text Style guide

Portfolio
SIMATIC AX
Product
SIMATIC AX
Software version
2510
Edition
02/2026
Language
English (original)
Package Name
@ax/st-styleguide

Programming guidelines are used to obtain a standard/uniform code that can be more easily serviced and re-used. Not only this, errors (bugs) can be identified at an early stage (e.g. by the compiler) and avoided. The source code should have the following properties:

  • A standard and unified style
  • Should be able to be easily read and understood
  • A certain appearance should initially be maintained regarding serviceability and transparency of the source code. Optical effects – e.g. a standard number of blanks before the comma – only play an insignificant role regarding the software quality. It is far more important for example, to find and select rules that support development engineers in the following way:
  • Avoid typing errors and careless mistakes that the compiler then incorrectly interprets. Objective: The compiler identifies as many errors as possible.
  • Support the code for identifying and resolving program errors and bugs; Objective: The code indicates problems at an early stage.
  • Standardize standard applications and libraries Objective: The program code is more easily learned and the reusability of program code is increased
  • Modularization
    • Objective: Increasing the level of transparency
    • Selectively use of sub-functions and simple combination of different modules by encapsulating and clearly separating sub-functions
    • Define clear and unique interfaces
  • Increase the serviceability and ongoing development Objective: Changes to the program code in the individual modules, that can involve functions/function blocks/programs or units in libraries or in the projects – should have a minimum impact on the total application/total library. Different programming engineers should be able to make changes to program code in the individual modules.

TIP

Customer's requirements have priority for customer applications. If the customer requests changes or deviations from these programming guidelines, then this has first priority. This must also be documented in writing. Rules defined by customers must be documented in the source text in a suitable form.