TIA PLC Program Structuring
TIA PLC Program Structuring
• Define logical and sub-logical module (Section the target process into sub-modules based on process functions and
equipment).
• Create program groups based on the Logical Modules.
• Structure Global data based on program group and sub-logical modules.
• Add Input/Output Tags based on process equipment/machine IO.
Example Application: Water Supply-Redistribution System
Supply
Module
Valve
Pump
Refill Module 2 Process Tank
Valve
Pump
Logical Modular Structure for the Process (Used in programming environment to create the PROGRAM GROUPS )
• Machine Module
• Equipment Module
Note these modules can vary depending on the Process Application being developed
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
Data Handling Structure for the Process (Used in programming environment to create the GLOBAL DATA BLOCKS )
• DB-Equipment
• DB-Machine
FB-Supply
FB-Equipment FB-Refill
Equipment FB-Refill
DB-Machine UDT-StateHandler
UDT-Supply
Global Data DB-Equipment UDT-Refill
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
OB1
FB-Equipment FB-Machine
Module/Group Module/Group
FB-Supply FB-Refill
FB-Refill FB-StateHandler FB-AlarmHandler
Module Module 2
Module 1
FB-
NetworkHandler
FB-
RecipeHandler
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
Data Call Hierarchy
UDT-StateHandler
UDT-Supply (Module) UDT- Refill (Module) (Module)
Supply Module
FB-Statehandler
FB-Refill
Ready Faulted
Refill Module
DB-
Process 1
Equipment
Running Reset
Refill Module
Process 2
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
Contents of a Global DB
A global DB is made up of data structures. These data structures are grouped into UDTs with struct datatype based on the
modules (FBs) in the groups. The UDTs are then grouped according to Equipment and Machine groups created earlier.
• Status (Sts)
• Command (Cmd)
• Configuration (Cfg)
• Fault (Flt)
Data Structures in the Machine group Modules’ UDT
Just as we have data structure for the UDTs of the modules (FBs) in the Equipment group, the same way we have for the
Machine group.
• State (Sta)
• Command (Cmd)
• Configuration (Cfg)
• Fault (Flt)
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
Adding Input and Output Tags
A structure is also used for adding IO tags to the project. Generally, IOs are associated with the devices they are connected
to for the purpose of sending the device status to the controller and also sending commands to the device from the controller.
From these IOs, tags are being setup according to groups and modules and then devices. Below is the recommended
hierarchy for IO tag list:
Group
Module
Device
• IO Tag1
• IO Tag2
⋮
• IO TagN IO Tags Structure
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
IO Tags associated with the application
process as an example
EQUIPMENT MACHINE
REFILL MODULE STATEHANDLER MODULE
GROUP
Pump Operator Interface
₋ Digital Input: Pump motor circuit breaker ₋ Digital Input: Pushbutton start application
₋ Digital Input: Pump local isolator ₋ Digital Input: Pushbutton stop application
₋ Digital Input: Pump running feedback MODULES ₋ Digital Input: Pushbutton reset fault
₋ Digital Output: Start pump operation ₋ Digital Output: Lamp application running
₋ Digital Output: Lamp application faulted
Valve DEVICES
₋ Digital Input: Valve position open feedback
₋ Digital Output: Open valve
Tank IO TAGS
₋ Analog Input: Actual water level indicator The rest of
the text
SUPPLY MODULE showing
names of IO
Tank tags, their
₋ Digital Input: Low level indicator. mode and
signal type
are the IO
tags.
TIA PORTAL PROGRAM STRUCTURING LIKE A PRO
IO and internal Tags naming recommendation