This quick-reference guide explains the essential elements you’ll use when programming in TIA Portal.
A PLC tag is a variable name assigned to a physical or logical input/output or internal memory in the PLC. It links your logic to actual hardware or simulation.
Example: "PICK_Stopper_EXTENDED" – controls an actuator to extend a stopper.
A CASE structure is a step-based control logic used to organise sequences and machine states.
🔹 Example:
CASE #Step OF
0: // Initialization
10: // Wait for sensor
20: // Move actuator
END_CASE;
Great for sequencing processes such as pick and place or sorting.
Used to check conditions in logic. If the condition is true, the block of code is executed.
Example:
IF "PICK_SENSOR_Stopper_WORKPIECE" THEN
"PICK_Gripper_GRIP" := TRUE;
END_IF;
Named data points used to store sensor values, actuator states, timers, counters, or control flags. You declare them in data blocks or locally in function blocks.
Used to introduce delays or check elapsed time.
Timer Type: TON (Timer On Delay)
Used With:
#DelayTimer(IN := TRUE,
PT := T#1s);
IF #DelayTimer.Q (timer finishes) THEN (do action)...
RESET_TIMER(timer_name); - resets timer
Delays are managed using timers. Timers help ensure reliable sequencing or physical actuation before the next step begins.
Use for: suction grip delay, actuator travel time, sensor debounce.
Used to count events, like number of workpieces or cycles. You can implement manual counters with INT variables.
Example:
IF "Sensor_Part_Entered" THEN
#WorkpieceCounter := #WorkpieceCounter + 1;
END_IF;
TIA Portal does not support traditional arrays in HMI/PLC, as is the case in other languages. However, you can simulate list behaviour using structured data types (UDTs) or arrays in data blocks.
Use structures like:
Slide1.Red, Slide1.Black, Slide1.Silver
Used to interact with the system. In TIA Portal, you can design HMI screens to:
Input orders (e.g., number of red/black pieces)
Show current counters
Display station status
Activate manual mode
HMI tags are variables explicitly used in the HMI interface. You link HMI tags to PLC tags for two-way communication.
Example: An HMI input field updates Slide1.Red in PLC.
A modular block of logic with memory (uses a Data Block). Each station should have its own FB for clean, organised programming.
Example: FB_SortingStation, FB_DistributionStation
Stores all the variables and state information for a function block. Can be shared or instance-specific.
Automatically created when you insert a function block.
PLCSIM Advanced is Siemens’ professional tool for simulating virtual PLCs, such as S7-1500 or ET 200SP CPUs, enabling complete testing without hardware.
Key Features:
Simulates logic, timers, counters, and signals.
Works with TIA Portal + Siemens NX MCD (Digital Twin).
Supports multiple virtual CPUs.
Supports network communication and HMI interaction.
Used to test digital twin models, monitor signal flow, and run real-time simulations with NX MCD.