How can you use one and the same WinCC flexible operator panel configuration for multiple controllers?
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.
The following parameters are assigned to the "Change connection" system function via IO fields:
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.
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.
|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:
WinCE_Write_data / (WinPC_Write_data)
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)
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).
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".
Point 1: Permanent window
Points 2 - 4: Overview of "Plant Screen 02"
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.
The attached download contains the archived WinCC flexible project with the functions described above.
Attachment 1: Project.zip ( 4517 KB )
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|
|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|