xType Definition

Introduction

In the XType Definition module, the blocks of a global TIA library developed and typed in the TIA Portal can be enriched with interconnection rules. This enables FAST to generate a standardized block with all the required variables and parameters.

 

Global TIA Libraries in FAST

Before you can work with the XType definition in FAST, an essential part is creating a global “corporate library” that contains the standardized functions to be generated.

To create and maintain a global standard block library, it is recommended to follow the Siemens library handling guide. 

https://cache.industry.siemens.com/dl/files/503/109747503/att_933082/v1/109747503_Library_Guideline_DOC_v10_en.pdf

 

Open XType Definition & TIA Library

To open the XType Definition, first check whether you have set the correct TIA Portal version in FAST. Next, click on the XType Definition tile in the start menu.

Loading the Global TIA Library

  • Click on one of the buttons “Open TIA Library”

  • Select the appropriate library from the file system and select the *alxx file (xx=TIA version).

DANGER If the file is not displayed, please check whether the TIA version number set in the FAST main menu corresponds to the library version number.

Overview XType Definition

  • Structure of the XType definition:

  • toolbar:

back to the start menu

Open TIA Library

Save changes in TIA library –> Changes are saved in the “Additional Files” folder of the TIA library.

Remove XType definition for selected objects

  • menu bar

Working with the XType definition

  • The editor for PLC user constants

Variable tables with user constants can be created in the PLC variable editor. The user constants can be used to define variable array limits in the DB editor or can be connected to an XType as a connection rule.

In the PLC variable editor, only user constants of a variable table can be edited. The following always applies: If the variable is not present in the defined variable table in the subsequent TIA project when it is generated, it is added to the corresponding table. The same applies to the entire variable table.

To create a new PLC variable table, click on “Add new variable table”. Once created, it can be edited in the PLC variable editor.

In order to recreate group folder structures of the base project or to create new ones, it is possible to create them in the XType definition.

Editing a user constant in a selected variable table works analogously to editing a variable in the TIA Portal.

  • The DB Editor

In the DB editor, existing DB structures can be recreated in the base project in order to assign them to an XType as a connection rule. Furthermore, you can also create structures that are to be newly created during generation.

  • PLC-wide tags function

In this function, group structures and global DBs can be defined. If the DB and/or the group structure does not exist in the target project at the time of generation, the DB will be created in the project depending on the settings - as defined in the DB editor.

To create new group folders or GlobalDBs, right-click on the PLC-wide tags folder entry. You can now select the desired object in the context menu.

As in the TIA Portal, it is also possible to create nested folder structures. Here, select the corresponding existing group folder object with the right mouse button and select the new object to be created.

Add new block:

To create a new global DB, it must be defined in the context menu as follows.

Group: Name of the target group folder for this DB.

Name: DB symbol name. This name is also used to check in the target project whether the DB to be generated exists. If this is not the case, the DB is created again.

Failsafe: A failsafe DB is created.

Type: Type of DB to be created (Fix Global DB)

Number: DB number assigned automatically or manually. The number is also used to check in the target project whether the DB to be generated exists. If this is not the case, the DB is created again. Address conflicts that occur during generation in the target project can be resolved subsequently using TIA Portal.

Optimized block access: Sets the attribute “optimized” for the global DB to be created.

Mode“Create xTags on request”: Creates xTags in data blocks only if they are also used in the project.

ModeCreate entire data block": Generates all xTags of the DB regardless of their actual use.

  • "Group-wide xTags" function

In this function, no individual DBs can be edited, only xTags which are later combined in a group-wide global DB. There are 3 group DB types in which xTags can be created:

  • Standard optimized: (GlobalDB with attribute “optimized”)
  • Standard not optimized: (GlobalDB with attribute "not optimized")
  • Fail-safe optimized (F-Global DB with attribute “optimized”)

DANGER The symbol of the group-wide DB is automatically generated from the guidelines defined in the style guide for creating a global DB, as well as from the target group folder name itself.

  • The xTag Editor

In the xTag Editor, xTags can be created in the DB selected in the DB Editor. When the xTag is generated in the target project, the corresponding target DB (if available) is checked to see whether the variable is already defined. If this is not the case, it is added to the DB. If the target DB does not exist, the corresponding DB is also newly created.

Creating a new xTag with a simple data type in the editor:

  1. Setting the cursor at the location where the xTag should be inserted:
  2. Add a new line with the buttons “insert” before the selection or “add” after the selection.
  3. Defining the variable. (Name/Data Type/Start Value/Attributes/Comment)
  4. The variable can now be used as an interconnection rule on an xType.

Creating a new xTag of the array data type in the editor:

  1. as points 1-3 Create a new xTag
  2. Select “Array” as the data type, a popup to define the array will automatically open.
  3. Now first select the data type of the array entries. Here it is possible to use simple data types or to select PLC data types that are contained in the global library.
  4. Now select the number of dimensions as well as the array lower and upper bounds. The array boundaries can also be specified dynamically using a user constant. –> see Editing PLC-wide xTags.
  • The xType Editor

In order to turn a standardized block from the global library into an xType that can be generated, it must be provided with at least one interconnection rule. This is done in the xTypes editor.

To do this, select the desired standard block from the library navigation. The block is now loaded and then displayed completely in the work window on the right.

To assign an interconnection rule to a parameter, select it by clicking on the associated parameter connection. You can then assign the desired interconnection rule to the parameter. If a warning sign is visible on a parameter, it must be interconnected in order to create an xType that can be generated.

Wiring rules

"None" – An existing interconnection at the selected parameter is deleted.

“PLC variables” – Here PLC variables can be interconnected at a generic level. Multiple selection is possible. The interconnection with an actual variable only happens when the xType is generated in MConfig. This can be done manually or automatically.

For this purpose, the “automatically wired” option can also be activated. In this case, a PLC variable is automatically created and interconnected with the parameter. The address space of the new variable is in the range >=10000.0

“Pre-connected network” – During generation, a temporary variable is created in the local data of the calling block and interconnected with the parameter. In addition, when generating, a new empty network is created around the block call, which already contains the interconnection to the temporary variable created. This function can be used to subsequently implement a logical operation AND/OR etc. on the parameter.

„xTag“ – With this interconnection rule, the same variable is interconnected for each generated instance of the xType. A variable from a global DB must be defined in the DB editor before use. If a local data variable is selected from the drop-down menu, the variable is automatically created in the local data based on the parameter name when generating the xType in the calling block.

Example selection of an xTag from a Global DB.

Result:

„Instance xTag“ – With this interconnection rule you can generate a unique xTag assigned to the instance. The symbolic name of the Instance xTag is automatically derived from the parameter name and the symbol of the InstanceDB. All you have to do is define which DB the xTag instance should be created in. You can choose between global DBs and the local data of the calling block.

Example of selecting an instance xTag:

Result:

The variable is displayed in the selected DB under the Instance xTags tab:

“Fixed value” – Here you have the option of assigning a fixed value to a parameter. This is then automatically given to each instance. The data type of the entered value must match the data type of the selected parameter.

Example:

Symbolism xType Status

An xType can have different processing states, which are visualized by icons in the library view. The following states are reported back:

The xType has no interconnection rules:

The xType has incomplete wiring rules:

The xType has inconsistent wiring rules:

The block has consistent interconnection rules and can be used for generation in MConfig:

  • Working with multiple xType versions

It is possible to further develop an xType that already has interconnection rules in the TIA Portal. The original version of the xType does not lose its xType definition as long as it is not deleted from the library.

The already created xType definition can be copied to the new xType definition with just a few clicks. To do this, select “copy” in the context menu of the old version.

Then select the new version of the xType and click “Insert” in the context menu.

The definition is inserted into parameters with the same name. If parameter names have changed or new ones have been added or deleted, these will not be taken into account during the insertion process and must be added manually.

Both versions can now be used for generation. However, it is recommended to only keep 1 version in the global library at a time. If you no longer need it, delete the old version after the copying process.