Lists of objects - Manual - TIA2ST - A CLI tool to import TIA Portal project data into a SIMATIC AX project. - TIA2ST - Convert parts of TIA Portal projects to ST code,tool

TIA2ST CLI Tool (tia2st)

Portfolio
SIMATIC AX
Product
TIA2ST
Software version
2.0.24
Edition
01/2025
Language
English (original)
Package Name
@ax/tia2st

To handle collections of objects the template language has been extended to iterate over lists {{#list}} .. {{/list}}. Inside the list you can access the properties of a single object, in following example, over the list of PLCs:

    {{#PLCs}}                                   // <-- for all PLCs
    /// {{Name}}
    /// {{TypeName}}
    ...
    CLASS {{Name}}                              // <-- generate a CLASS with name of a PLC
       ...
    END_CLASS
    {{/PLCs}}

To modify the class name, you can easily add text to the template file, like ...

    CLASS TO_Initializer_for_PLC_{{Name}}