Siemens Industry Online Support
Siemens AG
Entry type: FAQ, Entry ID: 37577813, Entry date: 08/12/2009

How can you use one and the same WinCC flexible operator panel configuration for multiple controllers?

  • Entry
  • Associated product(s)

When creating serial plants, the question always arises as to how you can use one HMI configuration for multiple plants without having to change the address parameters for the PLC in the configuration.

The aim is to create just one HMI configuration and to change the address parameters for the controller connection to the PLC at Runtime and store them permanently.

The following describes the procedure taking a practical example.
You can use the function on operator panels that support Script and Archive functions.

No. Procedure
1 Function description
The following parameters are assigned to the "Change connection" system function via IO fields:
  • Address
  • Slot
  • Subrack

The name of the connection is defined and stored, and cannot be changed.

The connection data predefined via the IO fields is written to an archive by script. When you restart the operator panel, a second script reads out this archived connection data.

The operator panel then sets up a connection to the PLC using this predefined connection data.

2 Create an HMI connection
First you configure a "standard connection" for your operator panel.
If the operator panel does not find any stored connection data, it attempts to use this fixed address to set up a connection to the PLC.

Fig. 01
3 Define tags
You need three internal tags to transfer the parameters to the "Change connection" system function.
A further internal tag is needed to ensure that the script used is called only once when the operator panel is restarted.

Two tags with controller connection were used for test purposes.

For later use, you must of course make sure that the data blocks and markers used to execute the program are identical in all the PLCs.

4 Script description for MP 277 / PC Runtime:
(The specifications in the "brackets" refer to the PC Runtime project.)

Two scripts are used in the sample projects:

  1. WinCE_Write_data / (WinPC_Write_data)
  2. WinCE_Read_data / (WinPC_Read_data)

WinCE_Write_data / (WinPC_Write_data)
The "WinCE_Write_data" script is executed via the "Save PLC data" button.
The connection data are stored via this script in a "Text" file.

You can change the storage location and the name of the file in line 13 (13 and 14).

In lines 37, 38 and 39 (63, 64 and 65) you can also change the tags used.

WinCE_Read_data / (WinPC_Read_data)
The "WinCE_Read_data" script is executed just once via the "Start" page of the operator panel.
This script reads out the previously stored connection data and executes the "Change connection" system function.

You can change the storage location and the name of the file in line 18 (21).

In lines 51, 52 and 53 (59, 60 and 61) you can also change the tags used.

The "Change connection" system function is executed with the tags used in line 65 (75).


  • The source codes for Windows CE systems and PC Runtime systems are different.
  • The archive path depends on the operator panel you are using.
    Refer to the relevant manual to see which archive path your operator panel supports.
  • You should not use the internal flash memory of the operator panel, because it affects the service life of the operator panel.
5 Program description
When you start the operator panel, the plant picture "Screen 01" (Start screen) is called first.
Opening of the "Screen 01" screen causes the script "WinCE_Read_data" to be executed.

If there is no connection data stored in the archive, the operator panel first attempts to set up the connection defined and stored in the configuration.

If the correct connection data is stored, the "WinCE_Read_data" script reads out the connection data and sets up the connection to the relevant PLC via the "Change connection" system function.

You can specify and change the connection data via the plant screen "Screen 02".

Below is plant screen 02 "Change PLC connection data".

Fig. 02

Point 1: Permanent window
You can call "Screen 01" and "Screen 02" via the permanent window. You can also change the language and stop Runtime via the permanent window.

Points 2 - 4: Overview of "Plant Screen 02"

Point 2
Via the IO fields, you specify the connection data of the PLC via which the operator panel is to communicate.

Point 3
The "Save PLC data" is for executing the "WinCE_Write_data" script. The previously entered connection data is stored in an archive. If you enter new connection data, pressing the button overwrites the "old" data.

The "Change Connection" button is for executing the "Change connection" system function. The connection data is transferred from the IO fields from "Point 2" to the system function.
For test purposes, therefore, you can check in Runtime whether your connection data functions.

Point 4
Via the IO fields you can specify and read out tag values for test purposes in order to ensure that you are connected with the "right" PLC.

The attached download contains the archived WinCC flexible project with the functions described above.

Attachment 1: Project.zip ( 4517 KB )

Creation environment
The example can be used on all operator panels that support script and archive functions.
The following table lists the components that have been used to create this entry.

Component Product and version designation
PC operating system Microsoft Windows XP SP2
Standard tools -
Engineering tools STEP 7 5.4 SP4
HMI software WinCC flexible 2008 SP1
HMI devices MP 277 Touch, PC Runtime
Controllers CPU 315-2DP, CPU 317F-2PN/DP


Security information
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about industrial security, please visit