Creating a TIA Portal Project from Scratch PLC, HMI, and VFD

David Krause15 min read
SiemensTIA PortalTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Creating a TIA Portal Project from Scratch: PLC, HMI, VFD, and S7 Classic Proxy Integration

This field reference walks through building a complete TIA Portal project from an empty workspace: configuring an S7-1500 CPU, programming alarm handling for three SINAMICS VFD-driven pumps and several temperature regulators, integrating a Comfort Panel, and bridging an existing S7-300/S7-400 (S7 Classic) controller into the same HMI through the device PLC proxy. The procedures map to the official Siemens TIA Portal documentation model and to the latest published manuals for STEP 7 V20 / WinCC V20.

1. Project Scope and Engineering Decisions

Before opening TIA Portal, lock down the following decisions. Each one drives the hardware list, licensing, and how alarm classes propagate from the controller to the HMI.

Decision Area Option Engineering Impact
Controller family S7-1500 (recommended) vs. S7-1200 S7-1500 supports full ProDiag, GRACEFUL_STOP, and S7 Classic OPC proxy. S7-1200 has reduced alarm and routing capability.
HMI platform Comfort Panel vs. WinCC Unified Comfort Panels (TIA Portal WinCC) use the same tag database as STEP 7. Unified PC and Unified Comfort Panels use a different graphics model and OPC UA routing.
VFD bus PROFINET vs. PROFIBUS PROFINET simplifies wiring and supports SINAMICS Startdrive integration. PROFIBUS still viable for retrofit of existing G120/G120C.
S7 Classic bridge Device PLC Proxy (HMI proxy) vs. OPC UA PLC Proxy couples an HMI tag directly to a remote S7-300/400 DB. OPC UA adds server cost but scales to multi-HMI/multi-controller.
Alarm concept Bit alarms vs. ProDiag vs. S7 Classic PCell-style Bit alarms are simplest. ProDiag (S7-1500 firmware ≥ V2.0) provides categorized diagnostics with automatic HMI messages.
Compatibility caveat: WinCC (TIA Portal) Comfort Panels only connect to one S7 Classic CPU per panel when using the PLC Proxy. For multi-CPU Classic aggregations on one panel, use the S7 Classic OPC server route or split the panel HMI tags across multiple panels.

2. Prerequisites

2.1 Software

  • TIA Portal V20 with STEP 7 Professional, WinCC Comfort/Advanced, and SINAMICS Startdrive option packages installed. See the official TIA Portal V20 - Creating a project reference page.
  • SINAMICS Startdrive V20 for direct G120, G120C, G120P, G130, G150, S120, S210 parameterization from inside the TIA Portal project tree.
  • License keys transferred to the Automation License Manager for STEP 7 Professional, WinCC Comfort (panel), and Startdrive (drive).
  • GSD/GSDML files for any third-party PROFINET device used in the project. Install via "Options > Manage general station description files (GSD)".

2.2 Hardware (Reference Bill of Material)

MLFB / Catalog Description Firmware
6ES7516-3AN02-0AB0 CPU 1516-3 PN/DP V2.9 / V3.0
6ES7531-7KF00-0AB0 AI 8xU/I/RTD/TC ST as of V3.0
6ES7532-5HF00-0AB0 AQ 8xU/I HS as of V3.0
6SL3244-0BB12-1FA0 SINAMICS G120 CU240E-2 PN V4.7 SP10 or later
6AV2124-1MC01-0AX0 Comfort Panel TP900 V16 / V17 / V18 image
6GK1901-1BB10-2AA0 PROFINET cable, FastConnect n/a

2.3 Network Plan

Reserve a fixed IP scheme. For a typical line with one PLC, one HMI, and three drives on PROFINET:

  • PLC: 192.168.0.1 / 255.255.255.0
  • HMI: 192.168.0.2 / 255.255.255.0
  • Pump 1 G120: 192.168.0.10
  • Pump 2 G120: 192.168.0.11
  • Pump 3 G120: 192.168.0.12
  • S7 Classic (S7-300 CPU 315-2 PN/DP): 192.168.0.20

3. Step-by-Step Project Creation

3.1 Create the Project

  1. Open TIA Portal.
  2. In the portal view, click "Create new project". Alternatively use the project view menu path: Project > New.
  3. Enter the project name, author, comment, and storage path. Confirm with "Create".
  4. The new project appears in the project tree; the device view is empty.
Always store the TIA Portal project on a local drive for performance. Network drives cause save-time blow-ups and break the SQLCE database used for the project file. Use the TIA Portal Portal Cloud connector or TIA Portal Multiuser Server (project server) for collaborative work, not a plain SMB share.

3.2 Add the S7-1500 Station

  1. Double-click "Add new device" in the project tree.
  2. Select "Controllers > SIMATIC S7-1500 > CPU > 6ES7516-3AN02-0AB0".
  3. Click "OK". The device view opens with the CPU rack.
  4. Open the hardware catalog, drag the AI and AQ modules into slots 4 and 5 (CPU occupies slot 1, PS slot 0).
  5. Right-click the CPU PROFINET interface and assign the IP 192.168.0.1, subnet 255.255.255.0; tick "Use IP router" only if you have a layer-3 PN/IO router.

3.3 Add the SINAMICS Drives

  1. Double-click "Add new device" again.
  2. Select "Drives > SINAMICS G120 > CU240E-2 PN".
  3. Repeat for pumps 2 and 3, then position them in the network view.
  4. Connect the PLC PROFINET port X1 to each drive port via drag-and-drop on the topology. TIA Portal automatically creates a PROFINET IO system and assigns device numbers 1, 2, 3.
  5. Open each drive, set the IP address, device name (must match the PROFINET device name in the project), and tick "Assign device name during PROFINET startup" if you are using topology-based commissioning.

3.4 Add the Comfort Panel

  1. Add new device → "HMI > SIMATIC Comfort Panel > TP900".
  2. In the HMI device configuration, set the HMI IP to 192.168.0.2.
  3. Under "Connections", add an HMI connection to the S7-1500 (the default once the HMI is in the network view near the PLC). Add a second HMI connection; change the partner to "S7-300/400 PLC (Proxy)".

3.5 Insert the S7 Classic PLC Proxy

  1. Project tree → "Devices & networks" → switch to network view.
  2. Drag "PLC > S7-300 > CPU 315-2 PN/DP" from the catalog into the network view but DO NOT add a new device. Instead, drag the "SIMATIC S7-300/400" entry under "HMI connections > S7-300/400 PLC (Proxy)" to bind to the existing remote S7-300.
  3. Set the S7 Classic partner IP to 192.168.0.20, slot 2 (CPU slot), rack 0.
  4. Tick "Establish active connection" if the HMI is to initiate; otherwise the S7-300 establishes it (default for S7 routing).

4. PLC Program Structure

Use the standard STEP 7 (TIA Portal) program blocks layout. For a project with three VFD pumps and several temperature regulators, the typical layout is:

Block Type Purpose
OB1 (or OB123 cyclic) Organization block Cyclic main, calls FC/FBs
OB82 Diagnostic interrupt Captures I/O module faults and routes them to alarm handlers
OB83 Module removal/insertion Catches hot-swap events on ET200SP
OB121 Programming error Catches DB access violations
FB100 "PumpCtrl" Function block Multi-instance template, one instance per pump (DB100, DB101, DB102)
FB200 "TempLoop" Function block PID_Compact instance per regulator
FC10 "AlarmDispatcher" Function Aggregates bit alarms into alarm classes
DB90 "AlarmBuffer" Data block Ring buffer of last 32 alarm records

4.1 Pump FB Interface

Define the FB so the instance DB becomes the HMI tag carrier. This avoids creating parallel HMI tag lists.


FUNCTION_BLOCK "PumpCtrl"
VAR_INPUT
  i_bStart : BOOL;          // from HMI start button
  i_bStop  : BOOL;          // from HMI stop button
  i_rSpeedSP : REAL;        // 0..100.0 [%]
  i_tRunTimer : TIME;       // min run time
END_VAR
VAR_OUTPUT
  q_bRunning : BOOL;
  q_bFault   : BOOL;
  q_wFaultCode : WORD;      // maps to drive r0947 / ZSW1 bit 3 + custom codes
  q_rSpeedAct : REAL;
END_VAR
VAR
  s_instCtrl : SINA_SPEED;  // SINAMICS standard block, FB285
  s_tStartTimer : TON_TIME;
END_VAR
BEGIN
  // Interlock + ramp logic
  // Drive telegram 1 (PZD-2/2) via s_instCtrl
  // Fault latch + clear
END_FUNCTION_BLOCK
Telegram layout: assign telegram 1 (PZD 2/2) for VFD control in the drive device configuration. Telegram 1 uses control word 1 (STW1) and status word 1 (ZSW1). For speed setpoint use NSOLL_A; for actual speed NIST_A. Telegram 3 adds the closed-loop torque channel but is not needed for pump control unless you have torque limiting.

4.2 Temperature Regulator

Drop PID_Compact (FB 1139 in the TIA Portal library) into the program and configure:

  • Setpoint scaling: 0..100 °C maps to 0..27648 raw.
  • Output: REAL 0..100 % → drive speed SP via FB100 interface, or analog output via AQ module.
  • Anti-windup: enable; integrator feedback on output saturation.
  • Tuning mode: "Pretuning" once on cold start, then switch to "Auto" after ramp completion.

4.3 Alarm Handling

S7-1500 supports two complementary alarm models.

4.3.1 Bit Alarms (legacy WinCC)

Create an alarm tag of type "BOOL alarm", assign trigger tag (e.g., "PumpCtrl_1".q_bFault) and message text. Bind it to an alarm class ("Failure", "Warning", "Message"). This is the simplest method and is the only method that matches PCS7 message conventions one-for-one.

4.3.2 ProDiag Alarms (recommended for new builds)

ProDiag (firmware ≥ V2.0 on S7-1500) generates categorized alarms automatically from PLC code annotations. Open the program block, place the cursor on a wire, and use "ProDiag overview > Add supervision". For each supervision, configure:

Parameter Recommended
Category Error / Warning / Information
Trigger Rising edge / falling edge / level
Delay 1000 ms (debounce)
Reaction None / Stop drive / Open valve

Compile the block and confirm ProDiag FB is generated automatically in the project tree. The HMI alarm view will populate with the categories without manual tag binding.

4.4 Classic → TIA Tag Bridge via PLC Proxy

To expose a Classic DB tag (e.g., DB50.DBD10) to the Comfort Panel:

  1. Open the HMI tag editor.
  2. Click "Add new tag".
  3. Connection: the S7-300/400 PLC (Proxy) connection you created in step 3.5.
  4. PLC name: the proxy symbol assigned (default "PROXY_DB").
  5. Address: DB50.DBD10 as REAL.
  6. Acquisition cycle: 500 ms.
The PLC proxy only works if the Comfort Panel supports the S7 Classic routing protocol. Verify in the device manual: TP700/TP900/TP1200 Comfort with image V14 or higher support the proxy. Older TP177B panels do not. For older panels, install an OPC server (e.g., SIMATIC NET OPC) on a PC station and expose Classic DBs as OPC DA items.

5. HMI Screens

5.1 Screen Hierarchy

Screen # Name Content
1 Overview Three pump icons with run/stop/fault, plant running hour counters, master start
2 Pump Detail Speed SP, speed PV, motor current, last fault code, reset button
3 Temperature Loops PID faceplate, setpoint, PV trend, auto/manual
4 Alarm View System-defined alarm control element
5 Trends 8-channel f(t) archive with 1 s sampling, 24 h ring buffer
6 User Admin Login, logout, role-based button enable

5.2 Tag Interconnection Pattern

Bind every HMI tag to the S7-1500 instance DB first; never duplicate tags as panel-internal variables. This guarantees one source of truth and lets the alarm viewer query the same DB fields the program uses. For the Classic DB tags, use the proxy connection only where absolutely required; convert where feasible to a structured data block on the S7-1500 and use GET/PUT to pull values from the S7-300 (slower, but avoids panel-side proxy complexity for non-critical data).

5.3 Alarm Display Configuration

  1. Drop the "Alarm view" control on screen 4.
  2. Configure the columns: Date/Time, Severity, Acknowledged, Source, Event text.
  3. In the alarm view properties, enable "Show pending alarms" and "Show acknowledged alarms".
  4. For ProDiag: the alarm class is automatically generated; no extra configuration.
  5. For bit alarms: assign the same alarm class names used in the Classic project (PCS7 standard: "Alarm", "Warning", "Failure", "Tolerance", "Process Message") to preserve operator familiarity.

6. SINAMICS Drive Parameterization

6.1 Startdrive Online Commissioning

  1. Right-click the G120 in the project tree → "Go online".
  2. Select the PROFINET interface as access point.
  3. Click "Assign IP" if blank, then "Assign PROFINET device name". The name must match the project (default: g120p-1).
  4. Open the parameter tree, execute "Factory reset" once if the drive is new, then "Upload parameters to PG".
  5. Run the Startdrive commissioning wizard: motor data from nameplate, application class "Standard drive" (p0501 = 1), control mode "Speed control without encoder" (p1300 = 20) for centrifugal pump load.

6.2 Key Parameters for Pump Service

Parameter Description Recommended for Pumps
p1080 Minimum speed 20 rpm (mechanical) for cooling bearing
p1082 Maximum speed nameplate
p1120 Ramp-up time 15 s (avoid water hammer)
p1121 Ramp-down time 20 s
p1300 Open-loop / closed-loop 20 (V/f) or 21 (V²f) for pumps without encoder
p2201[0] Fixed setpoint 1 for service / jog
p2104 Fault reaction 2 (ramp-down then coast)
p2118 Change acknowledge mode 1 (manual ack required)
p2155 Speed threshold ramp-down alarm trigger

6.3 Fault Code Mapping

The most common G120 pump-service faults and their handling in the S7-1500:

Drive r0947 Code Meaning PLC Action
F30001 Overcurrent Latch fault, set q_bFault=TRUE, alarm "Pump X: Overcurrent", inhibit auto restart
F30004 DC link overvoltage Extend p1121 ramp-down, alarm
F30005 DC link undervoltage Trigger "mains loss" reaction via F30005
F30011 Line supply failure Hold drive on mains return, do not auto-restart on safety input
F07900 Motor blocked Stop drive, alarm, require manual ack
F30903 PROFINET communication fault Switch to fallback speed setpoint (p2201), alarm
A07901 Motor speed deviation Warning, do not stop

Capture the active fault via SINA_SPEED input Fault (WORD) and copy into the pump FB output q_wFaultCode so the HMI faceplate displays the standard Siemens drive diagnostic number, not a custom code.

7. Compile, Download, and Verification

7.1 Compile Order

  1. Right-click PLC → "Compile > Software (rebuild all)".
  2. Right-click HMI → "Compile > Software (rebuild all)". This forces the HMI to read the latest tag database and rebuild the runtime.
  3. Resolve any "Address in use" warnings before downloading.

7.2 Download Sequence

  1. PG/PC interface: select your PROFINET or Ethernet adapter, set access to the subnet 192.168.0.0/24.
  2. Online → Accessible nodes. Verify all devices appear.
  3. Assign PROFINET device names in this order: PLC, drives, HMI, Classic proxy only after the PLC has the S7 routing enabled.
  4. Download to PLC: include program blocks, keep current hardware config or replace fully (replace deletes existing programs and DBs; keep preserves current online values).
  5. Download to HMI: enable "Overwrite existing user administration" if migrating from PCS7 user list.

7.3 Verification Checklist

# Check Pass Criteria
1 PLC goes to RUN RUN LED green, no SF/DIAG alarms
2 Drives on PROFINET BF LED off, RDY LED green
3 HMI starts Startup screen appears in < 30 s
4 Tag live values Force a BOOL in the PLC; HMI screen toggles within 500 ms
5 Alarm visibility Trigger a configured bit alarm; the alarm appears with correct class and timestamp on screen 4
6 Classic proxy Modify a Classic DB value; the corresponding HMI tag reflects within 1 s
7 Trend display Trends are drawn with 1 s sample
8 Pump jog Start each pump from the HMI; speed follows setpoint; fault code clears
9 Temp regulator PID pretuning completes without overshoot above 110 % PV
10 User admin Logout disables start buttons; correct role required to ack alarms

8. Troubleshooting Matrix

Symptom Likely Root Cause Action
HMI cannot find the S7-300 proxy Routing not enabled on the S7-300, or wrong slot Enable "Use router" in the S7-300 NetPro, set PG/PC slot to 0.2, rack 0
Alarm shows raw tag name, not configured text Alarm text not assigned or wrong language selected Open PLC alarm configuration → assign text in active runtime language
Drive r0947 = 0 even though drive is faulted Telegram mismatch (configured 2/2, drive has 999) Match telegram in drive device config, download again
HMI value flickers Acquisition cycle too short, network jitter Set acquisition to 500 ms minimum for non-critical, 100 ms only for alarms
PID_Compact output always 0 Input scaling wrong or Config mode active Open PID_Compact online, switch to "Auto", verify InputScaling limits
ProDiag FB not generated Compiler setting off PLC properties → "Compile > Generate ProDiag FB" = active
Compile warning "Address in use" Two devices assigned same IP Reassign IP addresses, recompile
S7-300 not reachable from HMI subnet No router configured on either device Add router IP in both devices' PROFINET interface properties

9. Field-Commissioning Notes

Three habits make commissioning faster and prevent late-site surprises:

  1. Compile before device swap. Always "Compile > Software (rebuild all)" after editing a single block and before touching a drive parameter. The cross-references across PLC, HMI, and Startdrive are interconnected and a partial compile can hide HMI tag changes until the next full build.
  2. Use the TIA Portal Openness interface for large IO. If the plant has more than 200 alarms, export/import via Openness (C# or VB.NET script). Manual entry is error-prone beyond that scale.
  3. Mirror Classic alarms into the S7-1500 DB. Even with the PLC proxy active, copy critical Classic alarm bits into the S7-1500 DB on each cycle and present them as bit alarms on the new HMI. This decouples the new HMI from any future Classic hardware change and gives the operator a single, consistent alarm list.

10. Migration Path from PCS7/WinCC Classic

If the question comes from a PCS7 or WinCC Classic background, the table below maps the familiar concepts to TIA Portal equivalents.

PCS7 / WinCC Classic TIA Portal Equivalent Note
CFC chart FB + multi-instance DB Compile unit concept dropped in TIA
SFC Graph (S7-Graph) or sequencer FB Use Graph for linear sequences, FB state machine for parallel
WinCC message configuration in Tag Logging PLC alarm editor + HMI alarm view Bit alarms or ProDiag
AS-OS engineering Single project (compile view from PLC to HMI) OS compile no longer required
S7 Classic multi-project TIA Multiuser project Multiple engineers, no project merger
Process tag container HMI tag table with PLC connection Direct DB binding

11. Demo Projects and Templates

Siemens publishes demo projects that can be opened directly in TIA Portal to jump-start a new build:

  • "S7-1500 with PID_Compact and HMI Comfort Panel": covers the FB200 faceplate pattern used in section 4.2.
  • "SINAMICS G120 Startdrive Commissioning": full wiring of SINA_SPEED to a G120 over PROFINET, including fault-code decoder.
  • "HMI ProDiag Function Blocks": source FBs for generating categorized HMI alarms from ladder/ST code.
Demo project search: open TIA Portal, choose "Help > Find sample projects", or browse the official TIA Portal documentation portal. The "Creating a project" entry page lists each major workflow step with screenshots and is updated every major TIA Portal release.

What is the minimum TIA Portal version that supports the Comfort Panel PLC Proxy for S7 Classic?

TIA Portal V13 SP1 with WinCC Comfort/Advanced SP1 or higher supports the S7-300/400 PLC proxy on Comfort Panels. Earlier versions fall back to OPC DA via SIMATIC NET.

How do I expose an S7-300 DB tag to a Comfort Panel without an OPC server?

Use the "S7-300/400 PLC (Proxy)" HMI connection. Enter the Classic CPU IP, rack 0, slot 2 (CPU 315) or slot 3 (CPU 400), then create the HMI tag with the same address syntax as in Step 7 Classic, e.g., DB50.DBD10.

Which drive telegram should I pick for a centrifugal pump on a G120?

Telegram 1 (PZD-2/2) is sufficient: control word 1, status word 1, NSOLL_A setpoint, NIST_A actual speed. Use telegram 3 only if you also need torque closed-loop control.

How do I make a ProDiag FB appear in the project tree?

Open the PLC block, place the cursor on a wire, choose "Add supervision", set a trigger and category, then "Compile > Software (rebuild all)". The generated ProDiag FB and category DBs appear automatically.

What is the recommended first acquisition cycle for HMI tags from the S7-1500?

500 ms for process tags, 100 ms only for alarms and interlocks. Cycles below 100 ms load the PROFINET IO update and do not improve HMI responsiveness visually.

Back to blog