Hierarchy 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

As demonstrated in the previous example, mustache can navigate through a multi-level object hierarchy, where the same property name might be associated with different objects:

NAMESPACE TiaProject.{{Name}}                     // <-- name of project
    {{#PLCs}}                                     // <-- for all PLCs in a project
    /// {{Name}}                                  // <-- name of a single PLC
    /// {{TypeName}}
    ...
    CLASS {{Name}}
    {{#Software.TechnologicalObjectGroup}}        // <-- for all groups of TOs in a PLC
        VAR PUBLIC
            {{#AllTechnologicalObjects}}          // <-- for all TOs in a group
            {{Name}}Reference : REF_TO {{Type}};  // <-- name and type of a single TO
            {{/AllTechnologicalObjects}}
        END_VAR
        ...

Understanding the hierarchy model used for conversion is crucial for successfully creating your own template file. The import command of tia2st uses an object model, which is described in detail here.