Professional Documents
Culture Documents
Description
A PLC data type (UDT) is a complex, user-defined data type that is used for the declaration
of a tag. It represents a data structure made up of several components of different data
types. The components can also be derived from another PLC data type, from an ARRAY
or directly using the STRUCT keyword as a structure. The nesting depth is hereby limited
to 8 levels.
You can change a PLC data type (UDT) centrally and use it repeatedly in the program
code. All locations of use are updated automatically.
Advantages of the PLC data types:
• Simple data exchange via block interfaces among several blocks
• Group data according to the process control
• Transferring a parameter as a data unit
-1-
Basics of PLC data types (UDT)
A maximum of 16K components can be defined per hierarchy level for each structure de-
scription (for example, a DB or a PLC data type (UDT)). These components can also be an
ARRAY or a STRUCT data type. When a structured component is hereby derived from an
explicitly declared PLC data type, there is no restriction. In other words, 16K components
of PLC data type (UDT)/SDT are supported for each hierarchy level. However, a maximum
of 252 of the 16K components can have "anonymous structures".
PLC data types can be nested to a depth of 8 hierarchy levels. This nesting depth is inde-
pendent of the CPU used.
Example
The following example shows the data type definition of the "MyUDT" PLC data type:
-2-
Basics of PLC data types (UDT)
Note
You can find more information on the PLC data types in the Siemens Industry On-
line Support in the following contributions:
How can you initialize structures in optimized memory areas at the S7-1500 in STEP 7
(TIA Portal)?
https://support.industry.siemens.com/cs/ww/de/view/78678760
How do you create a PLC data type (UDT) at an S7-1500 control system?
https://support.industry.siemens.com/cs/ww/de/view/67599090
How is the specific application of own PLC data types (UDT) effected in STEP 7 (TIA
Portal)?
https://support.industry.siemens.com/cs/de/de/view/67582844
Why should complete structures be transferred at a block call for S7-1500 instead of
many individual components?
https://support.industry.siemens.com/cs/ww/de/view/67585079
See also
Addressing PLC data types (UDT)
Declaring tags based on a PLC data type
Declaring tags based on a PLC data type
Comparing PLC tags
Creating structured PLC tags
Permissible addresses and data types of PLC tags
CMP ==: Equal (S7-1200, S7-1500)
Transferring a tag of the PLC data type (UDT)
-3-