Example - References - SIMATIC AX - AX Hardware Engineering documentation - Hardware Engineering,

Hardware Engineering reference

Portfolio
SIMATIC AX
Product
SIMATIC AX
Software version
2.0.0-alpha1.56
Edition
08/2025
Language
English (original)
Package Name
@ax/hw-docs

The following example shows the definition and usage of a template named DQ_Template.

The template is used twice in Device1, so the device includes two modules of the same type that only differ in their name and the output address.

  • The first output module DQ_1 uses the default output address 32.
  • The second output module DQ_2 uses the output address 64.
{
  "Templates": {
    "Modules": [
      {
        "Name": "DQ_Template",

        "Placeholders": [
          { "Name": "ModuleName" },
          {
            "Name": "OutputAddress",
            "Value": "32",
            "AllowedValues": [ "32", "64" ]
          }
        ],

        "Content": {
          "Name": "${ModuleName}",
          "TypeIdentifier": {
            "OrderNumber": "6ES7 522-1BL01-0AB0",
            "Version": "V1.1"
          },
          "IoConfiguration": {
            "OutputAddress": "${OutputAddress}"
          }
        }

      }
    ]
  },

  "Devices": [
    {
      "Name": "Device1",
      "Modules": [
        {
          "Name": "PLC_1",
          "TypeIdentifier": {
            "OrderNumber": "6ES7 516-3AN01-0AB0",
            "Version": "V2.9"
          },
          "AccessProtection": {
            "AccessLevel": "NoAccess"
          }
        },
        {
          "Apply": {
            "TemplateName": "DQ_Template",
            "Arguments": {
              "ModuleName": "DQ_1"
            }
          }
        },
        {
          "Apply": {
            "TemplateName": "DQ_Template",
            "Arguments": {
              "ModuleName": "DQ_2",
              "OutputAddress": "64"
            }
          }
        }
      ]
    }
  ]
}

The configuration above is equivalent to the configuration below that does not use templates. Note that the settings for the output module have to be specified multiple times.

{
  "Devices": [
    {
      "Name": "Device1",
      "Modules": [
        {
          "Name": "PLC_1",
          "TypeIdentifier": {
            "OrderNumber": "6ES7 516-3AN01-0AB0",
            "Version": "V2.9"
          },
          "AccessProtection": {
            "AccessLevel": "NoAccess"
          }
        },
        {
          "Name": "DQ_1",
          "TypeIdentifier": {
            "OrderNumber": "6ES7 522-1BL01-0AB0",
            "Version": "V1.1"
          },
          "IoConfiguration": {
            "OutputAddress": "32"
          }
        },
        {
          "Name": "DQ_2",
          "TypeIdentifier": {
            "OrderNumber": "6ES7 522-1BL01-0AB0",
            "Version": "V1.1"
          },
          "IoConfiguration": {
            "OutputAddress": "64"
          }
        }
      ]
    }
  ]

}