Press ESC to close · Ctrl+K to open

Secure Siemens PLC Communication with HMI and PC/PG

Step by step from TIA Portal to Runtime: protected PLC, protected project, encrypted loading and PLC-HMI communication with WinCC Unified.

Secure Siemens PLC Communication with HMI and PC/PG

Objective and complete flow

The objective is to establish secure communication between a Siemens PLC and a WinCC Unified SCADA Runtime.

To do this, first prepare several settings in the TIA Portal project: both PLC security and protection for the project itself. In this example the PLC is simulated with PLCSIM Advanced, the PLC IP is 192.168.1.188 and the PC Runtime IP is 192.168.1.169.

  1. Protect the PLC and avoid anonymous or unprotected access.
  2. Protect the project and enable the Security Features.
  3. Prepare the PLC network, test tags and FC.
  4. Configure WinCC Unified Runtime and the HMI-PLC connection.
  5. Load the PLC and SCADA, then verify encrypted communication.

As an external reference, it is useful to keep the Siemens documentation for encrypted loading in RT Unified close at hand.

Step 1: PLC security

Create the project and open the PLC security settings. This first step protects the CPU.

Initial Siemens PLC security settings in TIA Portal
Enabling PLC Security settings

Follow the security wizard and prepare the base configuration before creating users and permissions.

First step of the PLC security wizard
Second step of the PLC security wizard

For this example, use local user management and configure an administrator for the project/PLC.

Local user management in the project

Do not allow anonymous access: leave that option unchecked.

Anonymous access disabled in PLC security

Leave everything protected so no unprotected access is allowed.

Unprotected access disabled in the PLC

The wizard shows the final summary of the security applied to the PLC.

Siemens PLC security summary

Step 2: project protection

The next step is to protect the project. Here a project user is created; keep these credentials safe, because losing them may prevent future access to the project.

Project protection in TIA Portal
Creating a user to protect the project

When creating the project user, TIA Portal asks you to enter or change the password for the user defined for the PLC.

Changing the PLC user password

Permissions that were not available before now appear because a project user exists.

Permissions available after creating the project user

Once the project is protected, the Security Features are enabled. From this point, certificates and advanced security options can be managed.

Security Features enabled in the project

The top area shows the logged-in user and the available user actions.

Logged-in user and user actions in TIA Portal

Step 3: PLC preparation

Configure the PLC network with the usual lab IP: 192.168.1.188.

PLC network configuration with IP 192.168.1.188

Reuse an FC and DB from another project, and enable clock memory and system memory. Then create Bool, Int and Real test variables, plus an FC to move those variables.

PLC test variables and logic

Compile the PLC and leave it ready to download into PLCSIM Advanced.

PLC compilation before downloading to PLCSIM Advanced

Step 4: WinCC Unified configuration

Add the WinCC Unified Runtime, which includes its own PC Station inside the project.

Adding WinCC Unified Runtime to the project

Add a network interface to the PC Runtime so it can communicate with the PLC.

PC Runtime network interface

Assign the destination PC IP, in this case 192.168.1.169, and connect it to the network previously created for the PLC.

PC Runtime IP and PLC network connection

Check in Devices & Networks that the PLC, network and PC Runtime are correctly linked.

Devices and Networks view with PLC and PC Runtime linked

Create a basic start screen by dragging PLC variables onto the screen. This lets TIA Portal automatically create the connection and the required HMI tags. The easiest way is to use a split view.

WinCC Unified screen with PLC variables dragged onto it

Confirm that the connection to the PLC has been created automatically.

Automatically created HMI-PLC connection

Also confirm that the variables have been created in HMI tags.

Variables created in HMI tags

Compile the HMI project and two transfer-related errors appear.

HMI compilation errors related to transfer

TIA Portal requests a transfer password. This password is used for HMI loading and protects communication between the engineering station and Runtime.

The password must meet the RT Unified complexity rules: between 8 and 120 characters, with at least one uppercase letter, one lowercase letter, one number and one special character. It must also match in the HMI device runtime configuration and in Runtime Manager.

HMI transfer password configuration

For the first time, if secure loading has not yet been configured in WinCC, it may be necessary to allow the initial transfer through an unencrypted load.

First loading option before secure loading is active

If we compile again now, there are no errors.

Successful HMI compilation

Step 5: device loading

Step 5.1: load the PLC

Start with the PLC download.

Starting the PLC download

Enable supported simulation to load the project into PLCSIM Advanced.

Enabling supported PLC simulation
Loading the PLC into PLCSIM Advanced

Enter the PLC password when TIA Portal requests it.

PLC password request during download

Start the simulated PLC.

Starting the simulated PLC
Simulated PLC running in PLCSIM Advanced

Step 5.2: load the SCADA

Load the SCADA into the virtual machine where Runtime runs, with IP 192.168.1.169.

Loading the SCADA into the Runtime virtual machine

Enter the password configured for encrypted loading.

Important point: the first time, download without encryption so the password is loaded on the PC station. Then enter it in SIMATIC Runtime Manager.

Password configuration in Runtime Manager

Start the Runtime.

Starting WinCC Unified Runtime

Validation and encrypted communication

Open the application and enter the credentials for the phs user created earlier with HMI permissions.

Login in WinCC Unified Runtime with phs user

You can enter the user in autostart or log in directly.

Autostart user configuration in Runtime
WinCC Unified Runtime screen after login

The HMI is now communicating with the PLC.

HMI communicating with the Siemens PLC

Is the communication encrypted? Yes: it uses an internal certificate generated by TIA Portal.

Encrypted communication between WinCC Unified and PLC
Internal certificate generated by TIA Portal for secure communication


Was this article useful?

Share on LinkedIn