TIA Portal ยท Track 05 ยท user-defined types

The Data Cookie-Cutter

Loose tags โ€” valve1_open, valve2_open, valve3_cycles โ€” rot fast. A User-Defined Type (UDT) is a cookie-cutter for data: design the shape once, stamp it as many times as you like, and when you change the cutter, every cookie changes with it. Watch.

๐Ÿงฑ type "Valve"๐Ÿ“ stamp manyโœ๏ธ edit once
01 ยท One edit, everywhere

Change the cutter, change every cookie

On the left is the type definition "Valve". On the right, four valves stamped from it inside "Plant".valves โ€” an ARRAY[1..4] OF "Valve". Click โž• add a field to the type and watch all four instances grow it at once. That ripple is the entire reason UDTs exist.

๐Ÿ“ TYPE "Valve"

the master shape

๐Ÿ“ฆ "Plant".valves : ARRAY[1..4] OF "Valve"

four stamps of the same cutter โ€” independent data, identical shape
3 fields ร— 4 valves

Imagine doing that edit by hand across 40 valves and a dozen DBs, plus the HMI. The UDT makes it one change in one place โ€” and it can never drift out of sync, because there's only ever one definition.

02 ยท Why it compounds

UDTs plug in everywhere

A UDT isn't just for DBs. The same type can be the data type of an FB's in/out, a tag in a global DB, an array element, and the structure an HMI faceplate binds to. Define "Valve" once and it's the shared vocabulary across the whole project.

๐Ÿง  As an FB interface. FB_ValveCtrl takes io : "Valve" โ€” so passing a whole valve is one wire, not eight loose tags. Add a field to the type and the interface updates itself.

๐Ÿ–ฅ๏ธ As an HMI binding. A faceplate bound to "Valve" works for valve 1, 17 or 200 โ€” point it at a different instance and every field re-binds at once.

03 ยท Check yourself

The drift problem

A plant has 60 identical mixing stations. Mid-project you must add a "lastCleanTime" field to each station's data. What's the clean way?