Creating a device - TIAPortal

TIA Portal Openness: API for automation of engineering workflows

ft:publication_title
TIA Portal Openness: API for automation of engineering workflows
Product
TIAPortal
Version
V21
Publication date
03/2026
Language
en-US
Creating a device

Requirement

Introduction

A device can be created via two methods, within a project or a device group:

  • Create a device via a device item type identifier like in TIA hardware catalog
    Device CreateWithItem(DeviceItemTypeId, DeviceItemName, DeviceName)

  • Create only the device
    Device Create(DeviceTypeId, DeviceName)

Name

Type

Description

DeviceItemTypeId

string

Type identifier of the device item

DeviceTypeId

string

Type identifier of the device

DeviceItemName

string

Name of the created device item

DeviceName

string

Name of the created device

See: Get type identifier of devices and device items

Program code

Modify the following code to create a device object via a type identifier:

Copies the following program code to clipboard.

private static void CreateDeviceWithTypeIdentifier(DeviceComposition devices)

{

    Device device = devices.CreateWithItem

    ("OrderNumber:6ES7 510-1DJ01-0AB0/V2.0", "PLC_1", "NewDevice");

    Device gsdDevice = devices.CreateWithItem

    ("GSD:SIEM8139.GSD/M/4 ", "GSD Module", "NewGsdDevice");

}

Program code

Modify the following code to create only the device object:

Copies the following program code to clipboard.

private static void DeviceObjectCreate(DeviceComposition devices)

{

    Device deviceOnly = devices.Create("System:Device.S7300", "S7300Device");

    Device gsdDeviceOnly = devices.Create("GSD:SIEM8139.GSD/D", "GSD Device");

}