Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

Application description Ÿ 10/2013

Realization of a Fault-
Tolerant Tunnel Lighting
System With S7-400H
SIMATIC H-System S7-400H

http://support.automation.siemens.com/WW/view/81066268
Warranty and liability

Warranty and liability

Note The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. The Application
Examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for ensuring that
the described products are used correctly. These application examples do not
relieve you of the responsibility to use safe practices in application, installation,
operation and maintenance. When using these Application Examples, you
recognize that we cannot be made liable for any damage/claims beyond the
liability clause described. We reserve the right to make changes to these
Application Examples at any time without prior notice.
If there are any deviations between the recommendations provided in these
application examples and other Siemens publications – e.g. Catalogs – the
contents of the other documents have priority.

We do not accept any liability for the information contained in this document.

Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
Copyright ã Siemens AG 2013 All rights reserved

not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
deficiency or breach of a condition which goes to the root of the contract
(“wesentliche Vertragspflichten”). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
the type of contract, except in the event of intent or gross negligence or injury to
life, body or health. The above provisions do not imply a change of the burden of
proof to your detriment.

Any form of duplication or distribution of these Application Examples or excerpts


hereof is prohibited without the expressed consent of Siemens Industry Sector.

Caution
The functions and solutions described in this article confine themselves to the
realization of the automation task predominantly. Please take into account
furthermore that corresponding protective measures have to be taken up in the
context of Industrial Security when connecting your equipment to other parts of the
plant, the enterprise network or the Internet. Further information can be found
under the Item-ID 50203404.
http://support.automation.siemens.com/WW/view/en/50203404

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 2
Table of contents

Table of contents
Warranty and liability ............................................................................................... 2
1 Task................................................................................................................. 4
2 Solution........................................................................................................... 6
2.1 Overview ........................................................................................... 6
2.2 Description of the core functionality.................................................... 8
2.2.1 Function block FB 100 “Tunnel_Lighting_System”.............................. 8
2.2.2 User interface for visualization on the local HMI panel...................... 10
2.3 Hardware and software components ................................................ 13
3 Realization of “Fault Tolerance” .................................................................. 15
3.1 The automation system S7–400H .................................................... 15
3.1.1 Description ...................................................................................... 15
3.1.2 Structure of the H-Systems .............................................................. 15
3.1.3 Function principle ............................................................................ 17
3.2 Distributed I/Os................................................................................ 17
3.2.1 Description ...................................................................................... 17
3.2.2 Redundant I/O structure................................................................... 17
3.3 Redundant connections ................................................................... 18
4 Program Blocks for Tunnel Lighting Control .............................................. 19
Copyright ã Siemens AG 2013 All rights reserved

4.1 General overview............................................................................. 19


4.2 Function block “H-SYS_STATUS” (FB 1) ......................................... 21
4.2.1 Description ...................................................................................... 21
4.2.2 Structure of the system status list W#16#0071 ................................. 21
4.2.3 Description of the interface .............................................................. 23
4.3 Function block “Tunnel_Lighting_System” (FB 100) ......................... 25
4.3.1 Description ...................................................................................... 25
4.3.2 Avoiding light flickering between activation levels ............................. 26
4.3.3 Description of the interface .............................................................. 27
4.4 Data block “SYS_DATA_HMI” (DB 101)........................................... 29
5 Configuration ................................................................................................ 32
5.1 Address overview ............................................................................ 32
5.2 Information on the hardware configuration ....................................... 34
5.2.1 Settings for the H-CPUs................................................................... 34
5.2.2 Configuration of the HMI panels ....................................................... 35
5.2.3 Defining the I/O redundancy ............................................................ 36
5.2.4 Configuration of the S7 connection .................................................. 37
5.3 Configuration instructions for the HMI panel ..................................... 38
5.3.1 Connection to the H station .............................................................. 38
5.3.2 Connections in WinCC flexible ......................................................... 39
5.3.3 The system function “WechseleVerbindung” .................................... 39
6 Installation .................................................................................................... 41
6.1 Hardware and software installation .................................................. 41
6.2 PC and controller configuration ........................................................ 43
6.3 Download of project data ................................................................. 48
7 Operation of the Application ........................................................................ 50
8 Related literature .......................................................................................... 55
9 History .......................................................................................................... 55

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 3
1 Task

1 Task
Introduction
The safe operation of a tunnel not only requires security systems (e.g. fire
protection systems), but also systems for ventilation, lighting and traffic sign
control.
For this reason, these systems should also be integrated in the tunnel security
concept and protected against damage.
Today, the use of redundant systems for tunnel operation is a mandatory
requirement, so as to ensure a high level of security and availability. The
complexity of fault-tolerant systems is alleviated through the use of modular
structures.
The individual modules – in this example the systems for safe tunnel operation –
can be easily separated from each other.
The example presented here focuses on the “tunnel lighting system” as a separate
module.
The lighting system is not merely important for traffic safety, it is also closely
connected with the smooth flow of traffic. A high degree of illumination quality
increases the driving safety and driving pleasure and thus conduces to a harmonic
traffic flow.
Copyright ã Siemens AG 2013 All rights reserved

Overview of the automation task


The following figure provides an overview of the automation task.
Figure 1-1

Light intensity areas

Entrance light Interior light Exit light

Light sensor

Control room 2
level 1
Control room 1 level 2
level 3

Choose Intensity level

Description of the automation task


The abrupt light changes when entering and leaving the tunnel shall be smoothed
by a tunnel lighting system which meets the adaptability of the human eye. The
operator control and monitoring functions shall be realized with the help of a local
HMI panel.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 4
1 Task

The following requirements shall be fulfilled by the automation system:


· Light intensity measurement outside the tunnel by means of a light sensor.
· Light intensity control:
– The entrance and exit lights depend on the values measured (three-step
control). The function and the values of the light at the entrance and exit
remain always the same.
– The interior light depends on the time of day.
· Plausibility check of the outside sensor measurement: A defect sensor or
external influences (e.g. fog) may lead to values that would not be measured
under normal conditions (e.g. correctly working light sensor, no unusual
external influences). This might lead to the measurement of a night situation
during daytime, for example.
· Realization of the tunnel lighting task using the fault-tolerant S7-400H system
on the basis of a function block.

The following points shall be realized with a local HMI panel:


· Changeover between automatic and manual mode.
· Control of the tunnel lighting levels.
· Specification of the light intensity limit values for the outside light sensor.
Copyright ã Siemens AG 2013 All rights reserved

· Indication of group information about the status of the fault-tolerant system.


· Display of the result from the sensor plausibility check.
· Password protection for the HMI panel to prevent unauthorized manipulation.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 5
2 Solution

2 Solution
2.1 Overview
Schematic layout
The following figure provides a schematic overview of the solution and its most
important components:
Figure 2-1
Control room 1 Control room 2
FB 100 S7-400H HMI-Panel HMI-Panel S7-400H FB 100
Tunnel_Lighting_ Tunnel_Lighting_
System System

synchronisation

Industrial Ethernet
Copyright ã Siemens AG 2013 All rights reserved

PROFIBUS DP

ET 200M ET 200M

Structure
Each control room is equipped with a fault-tolerant system (CPU 416-5H) including
a distributed I/O system (ET200M) and an HMI panel.
The ET 200M is a redundant system (two head modules) which is additionally
provided with an analog input module and a digital output module.
The HMI panel (MP 370 Touch) is used for visualization and operator control.
Network integration is laid out as follows:
· The S7-400H stations and the HMI panel are connected via Industrial Ethernet
· In control room 1: Connection of the CPU with always the first head module of
the ET 200M stations via PROFIBUS DP.
· In control room 2: Connection of the CPU with always the second head module
of the ET 200M stations via PROFIBUS DP.

Note In our test setup, the use of an analog module for connection with the outside
sensor has been omitted, as the light intensity is entered manually in this
example application.

Advantages
The solution presented here offers the following advantages:

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 6
2 Solution

· Configuration and programming of the H-systems is identical to that of


standard systems; only a few additional hardware components are required.
· No further configuration of the redundancy-specific functions and
configurations. This is effected by the optional package “S7-H-Systems”
(integrated in STEP 7 Version 5.3 or higher).
· Integrated self-diagnosis function of the H-system (besides the standard
diagnosis functions) for advance error identification and indication, before
these errors affect the process.
· Replacement of components (hot swapping) and performance of program and
configuration changes while the system remains running.
· The use of two control rooms enables the local distribution of redundant
systems. If a fire breaks out in one control room, the redundant system will
take over and vital functions such as ventilation, lighting and traffic signaling
will remain operative.
· Realization with the function block FB 100 makes the system for tunnel lighting
control transparent to the user so that it can be easily modified or expanded.

Assumed knowledge
The following knowledge is assumed:
· Basic experience with STEP 7
Copyright ã Siemens AG 2013 All rights reserved

· Basic experience with fault-tolerant systems, S7-400H


· Basic experience with WinCC flexible

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 7
2 Solution

2.2 Description of the core functionality


2.2.1 Function block FB 100 “Tunnel_Lighting_System”.

Overview
The core element of the automation task is the function block
“Tunnel_Lighting_System”.
This block is used to control the tunnel lighting for the entrance, interior and exit
zones in automatic or manual mode.
The function principle of the block depends on the selected mode of operation.

Function principle in automatic mode


In automatic mode, a light sensor measures the light intensity outside the tunnel.
Depending on the result, the light intensity level of the entrance and exit light will
be adapted accordingly.
The table below shows the sensor limit values and the associated light levels for
the entrance and exit zones.
Table 2-1
Light intensity measured by the outside sensor Level
in Cd (lm/ser)
Copyright ã Siemens AG 2013 All rights reserved

Set_Val_Lev1 - Set_Val_Lev2 Level 1


Set_Val_Lev2 - Set_Val_Lev3 Level 2
Set_Val_Lev3 - Set_Sensor_MAX_VAL Level 3
The sensor intensity limits (Set_Val_LevX) are defined via the local HMI panel.
The interior light is also broken down into three levels and depends on the relevant
time of day.
Table 2-2
Time of day Level
Nighttime: 00:00 to 06:00 and 20:00 to 23:59 Nightlight
Sunrise or sunset time: 6:00 to 8:00; Morning and evening twilight
18:00 to 20:00
Daytime: 08:00 to 18:00 Daylight

The functional interaction of the required light levels between entrance, exit and
interior light are listed in the following table:
Table 2-3
Time of day Expected light intensity Level
00:00 to 06:00 Set_Val_Lev1 - Set_VAL_Lev2 Level 1 or nightlight,
20:00 to 23:59 respectively
6:00 to 8:00 Set_Val_Lev2 - Set_VAL_Lev3 Level 2 or evening and
18:00 to 20:00 morning twilight,
respectively
08:00 to 18:00 Set_Val_Lev3 -Set_Sensor_MAX_VAL Level 3 or daylight,
respectively

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 8
2 Solution

The function block FB 100 “Tunnel_Lighting_System” performs a plausibility check


of the light intensity values measured by the sensor.
If this check is negative, e.g. resulting from a defect or incorrect light sensor values
(weather conditions: fog or rain), the required light levels for the entrance, exit or
passing zones will be activated automatically. In addition, a message will appear
on the local HMI panel.
The light control system can be explained by the following example:
If a light intensity between “Set_Val_Lev3” and “Set_Sensor_MAX_VAL” is
measured during daytime, light level 3 will be activated automatically for the
entrance and exit zone. The interior light will be set to “daylight” in accordance with
the time of day.
.

Function principle in manual mode


In this mode of operation, the lighting of the entrance, exit and interior zones is
controlled with the help of three manually controlled light levels. The light levels are
activated via the local HMI panel. The table below shows the relation between the
manually controlled light levels and the associated light levels in the entrance, exit
and interior zones.
Table 2-4
Desired light level Entrance and exit zones Interior zone
Copyright ã Siemens AG 2013 All rights reserved

Entrance_Exit_Level1_Man Entrance_Exit_Level1 Nightlight


Entrance_Exit_Level2_Man Entrance_Exit_Level2 Morning and evening
twilight
Entrance_Exit_Level3_Man Entrance_Exit_Level3 Daylight

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 9
2 Solution

2.2.2 User interface for visualization on the local HMI panel

Each control room is equipped with a local HMI panel. The user interface for
visualization on the panels is identical.
Visualization on the local HMI panels
Figure 2-2
Copyright ã Siemens AG 2013 All rights reserved

Note Visualization can also be effected with WinCC flexible Runtime.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 10
2 Solution

Explanation of the display


The meaning of the individual elements in the user interface for visualization are
explained in the following table.
Table 2-5
WinCC Objects Function Explanation
Select automatic mode

Select manual mode


Select light level 1 Entrance and exit light level 1 for manual
mode
Select light level 2 Entrance and exit light level 2 for manual
mode
Select light level 3 Entrance and exit light level 3 for manual
mode
Set the elapsed-time counter to Here you set the elapsed-time counter of the
a defined value. CPU to a predefined value “PV”
Activate the WinCC display The WinCC display “Sensor_Set_Values” is
“Sensor_Set_Values”. used to define the light intensity limit values
for the outside sensor.
Output the current value of the
elapsed-time counter.
Copyright ã Siemens AG 2013 All rights reserved

Current light intensity measured


by the outside sensor in
Candela.

Cyclic output information on the The plausibility check shows an error /


plausibility check of outside shows no error.
sensor measurement, if either
or no error, or if an error was
detected.

Log on: User logon. To log on for multipanel operation, you


Log out: User logout. require the following log on data:
Registered user output field User: “Admin”
Password: “siemens”
Close RUNTIME on the HMI
panel.
Light level simulation field (1-3)
in the entrance and exit zones.

Daylight simulation field in the Will be activated, if the sensor plausibility


entrance and exit zones. check shows an error for the period between
08:00 and 18:00.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 11
2 Solution

WinCC Objects Function Explanation


Evening and morning twilight Will be activated, if the sensor plausibility
simulation field in the entrance check shows an error for the periods
and exit zones. between 06:00 and 08:00 or 18:00 and
20:00.

Nightlight simulation field in the Will be activated, if the sensor plausibility


entrance and exit zones. check shows an error for the period between
20:00 and 06:00.

Interior light for the period


20:00-06:00.
Interior light for the periods
06:00-08:00 and 18:00-20:00.

Interior light for the period


08:00-18:00.
Copyright ã Siemens AG 2013 All rights reserved

Information about the current Group information:


H-system status in the control · CPU definition within the H-system
rooms.
– Master
– Standby
· CPU operating status
– RUN_R: redundant mode
– RUN_S: solo mode
– Stop

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 12
2 Solution

2.3 Hardware and software components


The function example was reproduced using the following components.
Hardware components
Table 2-6
Component Qty. Order number Note
Power SupplyAC120/230V/10A 2 6ES7 407-0KA01-0AA0 Standard power supply
module
Power Supply AC120/230V/5A 2 6ES7 307-1EA00-0AA0 Standard power supply
module
CPU 416-5H 2 6ES7 416-5HS06-0AB0 Firmware V6.0 or later
IM153-2 HF 4 6ES7 153-2BA02-0XB0 Redundant structure
DO SM 322 for ET 200M 2 6ES7322-8BH00-0AB0 Digital output module
MP 370 Touch 2 6AV6 545-0DA10-0AX0 12’’ HMI panel
PC 1 For engineering purposes
SCALANCE X208 2 6GK5208-0BA10-2AA3
Copyright ã Siemens AG 2013 All rights reserved

Note You may also use similar products which deviate from the list above. In this
case, please note that changes to the sample code (e.g. different addresses)
may become necessary.

Please also note that a pairwise and redundant installation requires the use of
Note
modules of the same product and firmware versions.

Software components
Table 2-7
Component Qty. Order number Note
SIMATIC STEP7 V5.5 +SP3 1 6ES7810-5CC11- Floating license for 1user
0YC5..
SIMATIC WinCCFlexible+ RUNTIME 1 6AV6612-0AA51-3CA5 Floating license for 1user
2008 SP3

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 13
2 Solution

Block library "Functional I/O Redundancy"


The block library “Functional I/O Redundancy” supplied with the S7-400 H options
package contains the following blocks supporting the redundant inputs and
outputs.
Table 2-8
Functional I/O redundancy blocks Applied Used in
FC 450 "RED_INIT": Initialization function X OB72, OB100 and OB102
FC 451 "RED_DEPA": Triggers re-enable function - -
FB 450 "RED_IN": Function block to read in redundant X OB1
inputs
FB 451 "RED_OUT": Function block to control X OB1
redundant outputs
FB 452 "RED_DIAG": Function block for the diagnosis X OB72, OB82,OB83 and OB85
of redundant I/Os
FB 453 "RED_STATUS": Function block for redundancy X OB1
status information.

Note Functionality and application of the blocks are described in the associated online
help.
Copyright ã Siemens AG 2013 All rights reserved

Further libraries
In addition, the following libraries from the SIMATIC library are required for this
example:
· “Redundant IO CGP V5.X“: Blocks for channel group granular redundancy
· “Redundant IO CGP V4.X”: Blocks for channel granular redundancy
· “Redundant IO MGP V3.X”: Blocks for module granular redundancy
These libraries can be opened in the SIMATIC Manager by selecting "File > Open
> Libraries"

Note For supplementary information on the subject of “Functional I/O Redundancy”,


please refer to the manual: “SIMATIC Fault-Tolerant Systems S7-400H”, see \3\.

Sample files and projects


The following list shows all files and projects used in this application example.
Table 2-9
Component Note
81066268_Tunnel_Lighting_System_v10.zip This zip file includes the
STEP 7- and WinCC flexible project.
81066268_Tunnel_Lighting_System _v10_de.pdf This document.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 14
3 Realization of “Fault Tolerance”

3 Realization of “Fault Tolerance”


3.1 The automation system S7–400H
3.1.1 Description

The requirements on tunnel lighting control are fulfilled with the help of a
fault-tolerant system.
The automation system S7–400H satisfies the high demands on availability,
intelligence and decentralization placed on modern automation systems.
Furthermore, it also provides all functions required for the acquisition and
preparation of process data, including functions for the control, management and
monitoring of plants and aggregates.

3.1.2 Structure of the H-Systems

Overview
In order to ensure the reliable availability of the S7–400H system even if an error
occurs, it is laid out in a redundant structure (master and standby station). All
essential components, such as the central processing unit (CPU), the power supply
Copyright ã Siemens AG 2013 All rights reserved

module and the hardware for connection between the two CPUs are doubly
present.
Usually, the master and standby stations are arranged in a centralized structure.
Figure 3-1

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 15
3 Realization of “Fault Tolerance”

In this application example, however, a centralized arrangement has been


studiously omitted and the H-system is placed in two separate module racks at two
separate locations (one at each end of the tunnel). Each rack is equipped with a
CPU and a power supply module (PS).
The advantage of this local separation is that the redundant system in control room
2 will step in case of need, for example if a fire breaks out in control room 1, so that
ventilation, lighting and traffic signaling can be continued without restrictions.

If the central structure shall provide for an extraordinarily high degree of


Note
availability, two redundant voltage supply systems may be used.

Central processing units


The heart of the S7–400H are two central processing units. During normal
operation, one CPU is defined as master CPU and the other one as standby CPU.

Power supply
The H-CPUs are supplied by a power supply unit from the standard system range
of the S7-400. To increase the availability of the power supply, you may also use
two redundant power supply units for each subsystem.
Copyright ã Siemens AG 2013 All rights reserved

Synchronization modules
The synchronization modules are the interlink between the two CPUs. They are
installed in the CPUs and interconnected by means of fiber-optic cables.
Figure 3-2

There are two types of synchronization modules:


· up to a distance of 10 m between the CPUs.
· up to a distance of 10 km between the CPUs.

Fiber-optic cables
The fiber-optic cables are used to interconnect the synchronization modules for the
redundant link between the two CPUs, whereby the upper and lower
synchronization modules are connected pairwise.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 16
3 Realization of “Fault Tolerance”

3.1.3 Function principle

The H-system is suitable to establish a redundant system environment with two


CPUs and so ensures switchover to the standby system, if the master system fails.
The event-controlled synchronization enables a fast and bumpless switchover
between the two stations in case of a failure. The redundant CPU steps in and
continues operation at the point of failure, so that no information or alarm will be
lost.
Under the aspect of user program processing, the S7-400H follows the same
principle as a standard system. The synchronization functions are integrated in the
operating system and run automatically and entirely in the background. These
functions need not be considered in the user program.
In a redundant operating mode, the user programs in the two CPUs are completely
identical and processing is performed in an event-controlled approach.

3.2 Distributed I/Os


3.2.1 Description

One decentralized I/O module ET200M is connected as DP slave to the fault-


tolerant automation system via PROFIBUS DP. The redundant structure is
Copyright ã Siemens AG 2013 All rights reserved

obtained by means of an additional ET 200M and an additional PROFIBUS DP


connection.

3.2.2 Redundant I/O structure

The add-on modules in the distributed I/O device ET200M, also referred to as
interface modules (IM), are used as a PROFIBUS DP interface. In a redundant I/O
structure, two interface modules (IMs) per ET 200M station are required and both
must be set to the same bus address.
This is to ensure bumpless continuation by the passive module, if the active add-on
module fails during operation. The active interface is indicated by the LED ACT of
the corresponding add-on module.
Connection of the redundant I/Os to the H-system is effected in the connected DP
slave mode. This means that both the master station and the stand-by station are
connected with the two ET200M stations.
Figure 3-3

Redundant module pair

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 17
3 Realization of “Fault Tolerance”

The use of redundant I/O modules ensures that the connected I/Os remain
available for the process, even if the following situations arise:
· Failure of a signal module
· Failure of an interface module
· Failure of the ET200M station
· Failure of an H-CPU
· Failure of a PROFIBUS-DP segment

3.3 Redundant connections


The demand for highest availability also includes the communication. Depending
on the specific network topology, redundant connections with automatic switchover
in case of failure can be realized. If a failure occurs, the fault-tolerant
communication will be continued automatically and entirely in the background.

Note In this application example, fault-tolerant communication has not been


configured.
Copyright ã Siemens AG 2013 All rights reserved

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 18
4 Program Blocks for Tunnel Lighting Control

4 Program Blocks for Tunnel Lighting Control


4.1 General overview
Graphical illustration
The graphic below shows the program structure of the entire STEP 7 project.
Figure 4-1

SFC 1,
SFC 51
FB 1
„H-SYS_STATUS“
DB 101
„SYS_DATA_HMI“
SFC 2, 3,4
FC 6, 8, 105
OB 1 FB 100
„Tunnel_Lighting_System“
Copyright ã Siemens AG 2013 All rights reserved

DB 102
„HMI_CONTROLLER“

Meaning of the blocks


The blocks fulfill the following functions:
Table 4-1
Block Function
OB 1 Organization block; called at cyclic intervals.
FB 1 “H-SYS_STATUS” Provides information on the current status of the H-system.
FB 100 Tunnel lighting control system.
“Tunnel_Lighting_System”
DB 101 “SYS_DATA_HMI” Display interface between HMI panel and CPU.
DB102 “HMI_Controller” Control interface between HMI panel and CPU.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 19
4 Program Blocks for Tunnel Lighting Control

Overview of standard functions


The following table shows the functions from the S7 standard library required for
the realization of the tunnel lighting control system.
Table 4-2
S7- Description Used in
Functions
SFC 1 SFC 1 "READ_CLK" (read system clock) is used to read FB1 “H-SYS_STATUS“
the clock time and date from the CPU.
SFC 2 With SFC 2 "SET_RTM" (set runtime meter) , the FB100
elapsed-time counter of the CPU can be set to a “Tunnel_Lighting_System“
specified value.
SFC 3 SFC 3 "CTRL_RTM" (control runtime meter) is used to FB100
start or stop the elapsed-time counter. “Tunnel_Lighting_System“
SFC 4 SFC 4 "READ_RTM" (read runtime meter) is used to FB100
read out the elapsed-time counter. “Tunnel_Lighting_System“
SFC 51 SFC 51 "RDSYSST" (read system status) is used to read FB1 “H-SYS_STATUS“
an SZL sub-list or an excerpt from an SZL sub-list.
FC 6 The function FC 6 is used to extract the data format FB100
DATE from the DATE_AND_TIME format. The DATE is “Tunnel_Lighting_System“
located between the limits DATE#1990-1-1 and
Copyright ã Siemens AG 2013 All rights reserved

DATE#2089-12-31.
FC 8 The function FC 8 is used to extract the data format FB100
TIME_OF_DAY from the DATE_AND_TIME format. “Tunnel_Lighting_System“
FC 105 The “Scale Values” function is used to convert integral FB100
values into real numeric values. “Tunnel_Lighting_System“

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 20
4 Program Blocks for Tunnel Lighting Control

4.2 Function block “H-SYS_STATUS” (FB 1)


4.2.1 Description

The function block “H-SYS_STATUS” (FB 1) is called in OB1 at cyclic intervals.


When the system function “RSYSST” (SFC 51) with the SZL-ID (system status list
ID) W#16#0071 is called within this function block, information on the current status
of the H-system will be read out.
This information will then be buffered in the global data block “SYS_DATA_HMI”
(DB101) for visualization of the H-system status on the local HMI panels.
For supplementary information on the individual system functions, please refer to
the manual: “System and Standard Functions for S7-300/400 Volume1/2“, see\5\.

4.2.2 Structure of the system status list W#16#0071

The sub-list identified by the SZL-ID (system status list ID) W#16#0071 provides
information on the current status of the H-system. 16 bytes can be read out in total.
The data record is structured as follows:
Table 4-3
Copyright ã Siemens AG 2013 All rights reserved

Content Length Description


redinf 2 bytes Information on redundancy
mwstat1 1 byte Status byte 1
Bits 0-3: Reserved
Bit 4: H-status of CPU in rack 0
=0: standby CPU
=1: master CPU
Bit 5: H-status of CPU in rack 1
=0: standby CPU
=1: master CPU
Bits 6/7: Reserved
mwstat2 1 byte Status byte 2
Bit 0: Synchronization between CPU 0 and CPU 1
=0: not possible
=1: possible
Bits 1/2: 0
Bit 3: Reserved
Bit 4:
=0: CPU not inserted in rack 0
=1: CPU inserted in rack 0
(in redundant mode: bit 4 = 0)
Bit 5:
=0: CPU not inserted in rack 1
=1: CPU inserted in rack 1
(in redundant mode: bit 5 = 0)
Bit 6: Reserved
Bit 7: Standby-master switchover since last re-enable
=0: no
=1: yes
hsfcinfo 2 bytes Info word to SFC 90 "H_CTRL"
Bit 0:
=0: re-enable inactive

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 21
4 Program Blocks for Tunnel Lighting Control

Content Length Description


=1: re-enable active
Bit 1:
=0: updating of standby enabled
=1: updating of standby disabled
Bit 2:
=0: link-up to standby enabled
=1: link-up to standby disabled
Bit 3-8: Reserved
samfehl 2 bytes Reserved
bz_cpu_0 2 bytes Mode of CPU in rack 0
W#16#0001: STOP (update)
W#16#0002: STOP (memory reset)
W#16#0003: STOP (self-initialization)
W#16#0004: STOP (internal)
W#16#0005: STARTUP (cold restart)
W#16#0006: STARTUP (warm restart)
W#16#0007: STARTUP (hot restart)
W#16#0008: RUN (solo mode)
W#16#0009: RUN-R (redundant mode)
W#16#000A: HOLD
Copyright ã Siemens AG 2013 All rights reserved

W#16#000B: LINK-UP
W#16#000C: UPDATE
W#16#000D: DEFECTIVE
W#16#000E: SELFTEST
W#16#000F: NO POWER
bz_cpu_1 2 bytes Mode of CPU in rack 1
(see values for bz_cpu_0)
bz_cpu_2 2 bytes Reserved
cpu_valid 1 byte Validity of variables bz_cpu_0 and bz_cpu_1
B#16#01: bz_cpu_0 valid
B#16#02: bz_cpu_1 valid
B#16#03: bz_cpu_0 and bz_cpu_1 valid
hsync_f 1 byte Status of connection quality
(valid only, if b bit 0 is set in mwstat2)
Bit 0: Fiber optics connection quality of the synchronization
modules in the upper receptacle is limited
Bit 1: Fiber optics connection quality of the synchronization
modules in the lower receptacle is limited
Bit 2-7: 0

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 22
4 Program Blocks for Tunnel Lighting Control

4.2.3 Description of the interface

The figure and table below show the call interface of the user function block
“H-SYS_STATUS” (FB 1).
Figure 4-2
Copyright ã Siemens AG 2013 All rights reserved

Input parameters
The input parameters have the following meanings:
Table 4-4
Parameter Data type Note

mstat1_Bit4 BOOL H-status of CPU in rack 0


=0: standby CPU
=1: master CPU
(Bit 4 from mwstat1 of SZL data record)
mstat1_Bit5 BOOL H-status of CPU in rack 1
=0: standby CPU
=1: master CPU
(Bit 5 from mwstat1 of SZL data record)
hsysnc_Bit0 BOOL Bit 0: Fiber optics connection quality of the
synchronization modules in the upper receptacle
is limited
(bit 0 from hsync_f of SZL data record)
hsysnc_Bit1 BOOL Bit 1: Fiber optics connection quality of the
synchronization modules in the lower receptacle is
limited
(bit 1 from hsync_f of SZL data record)
mstat2_Bit0 BOOL Bit 0:Status of synchronization connection 01:
Synchronization between CPU 0 and CPU 1
=0: not possible

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 23
4 Program Blocks for Tunnel Lighting Control

Parameter Data type Note

=1: possible
(Bit 0 from mwstat2 of SZL data record)
bz_cpu_0 WORD Operating status of CPU in rack 0
(bz_cpu_0 of SZL data record)
bz_cpu_1 WORD Operating status of CPU in rack 1
(bz_cpu_1 of SZL data record)

Output parameters
The output parameters have the following meanings:
Table 4-5
Parameter Data type Note

PLC_Rack_0_Master BOOL H-status of CPU in rack 0


=0: standby CPU
=1: master CPU
PLC_Rack_1_Master BOOL H-status of CPU in rack 1
=0: standby CPU
=1: master CPU
Copyright ã Siemens AG 2013 All rights reserved

Syn_Link_UP_01 BOOL Status of synchronization connection 01:


Synchronization between CPU 0 and CPU 1
=0: not possible
=1: possible
Fiber_optic_Con_0 BOOL =0: faultless
=1: Fiber optics connection quality of the
synchronization modules in the upper
receptacle is limited
Fiber_optic_Con_1 BOOL =0: faultless
=1: Fiber optics connection quality of the
synchronization modules in the lower
receptacle is limited
PLC_Rack_0_Stop BOOL CPU rack 0 in STOP mode
PLC_Rack_1_Stop BOOL CPU rack 1 in STOP mode
PLC_Rack_0_RUN_S BOOL CPU rack 0 in solo mode
PLC_Rack_1_RUN_S BOOL CPU rack 1 in solo mode
PLC_Rack_0_RUN_R BOOL CPU rack 0 in redundant mode
PLC_Rack_1_RUN_R BOOL CPU rack 1 in redundant mode

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 24
4 Program Blocks for Tunnel Lighting Control

4.3 Function block “Tunnel_Lighting_System” (FB 100)


4.3.1 Description

The function block “Tunnel_Lighting_System” is used to control the tunnel lighting


system for the tunnel entrance and exit zones.
A light sensor measures the light intensity outside the tunnel and via an analog
input the measuring signal is transmitted to the controller.
Depending on the measured value, the light intensity in the entrance and exit
zones is regulated in three levels (see chapter 2.2.1).
The interior light is also broken down into three levels according to the relevant
time of day (also refer to chapter 2.2.1). In performing these tasks, the function
block uses the standard functions from the S7 standard library (see chapter 4.1).
The correlation between the individual light levels as required in the entrance, exit
and interior zones is shown in the following table:
Table 4-6
Time of day Expected light intensity Level
00:00 to 06:00 Set_Val_Lev1 - Set_VAL_Lev2 Level 1 or nightlight
20:00 to 23:59
Copyright ã Siemens AG 2013 All rights reserved

6:00 to 8:00 Set_Val_Lev2 - Set_VAL_Lev3 Level 2 or


18:00 to 20:00 morning/evening twilight
08:00 to 18:00 Set_Val_Lev3 - Set_Sensor_MAX_VAL Level 3 or daylight
The plausibility check of the light intensity measurement by the sensor is performed
within the function block on the basis of defined real light intensity values over the
course of the day. If this plausibility check shows a negative result, e.g. due to
incorrect values supplied by the light sensor (weather conditions: fog or rain), or a
defect, either daylight, nightlight or evening/morning twilight will be activated,
depending on the clock time.

Note The light intensity measured by the outside sensor is defined manually at the
“Tunnel_Lighting_System” block (FB 100).

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 25
4 Program Blocks for Tunnel Lighting Control

4.3.2 Avoiding light flickering between activation levels

The selection of the light level for the entrance and exit zones depends on the light
intensity measured outside the tunnel by the light sensor.
Table 4-7
Light intensity measured by the outside sensor Level
in Cd (lm/ser)
Set_Val_Lev1 - Set_Val_Lev2 Level 1
Set_Val_Lev2 - Set_Val_Lev3 Level 2
Set_Val_Lev3 - Set_Sensor_MAX_VAL Level 3
Weather-induced influences or similar reasons may cause variations in the results
of light intensity measurement. If this occurs at the defined transitions to adjacent
light levels, fast changes in the light levels cannot be avoided.
Light intensity
Set_Sensor_Max_
Value

Level 3
Copyright ã Siemens AG 2013 All rights reserved

Set_Value_Lev3

Level 2

Set_Value_Lev2

Level 1

Set_Value_Lev1
00:00 06:00 08:00 18:00 20:00 23:59

Nightlight Twilight Daylight Twilight Nightlight Time

In order to avoid light flickering at least for minor variations, a hysteresis is used.
This hysteresis represents sort of an “environment” around the setpoint value
within the range of which the actual value may vary. The control system will react
only, if the actual value exceeds the maximum value or falls below the minimum
value of this range.
In this application, the hysteresis is controlled with the help of a timer. If the value
measured by the sensor exceeds a defined limit to the next light level, a timer will
be started (time value: 1 minute). If the sensor value levels out to the previous
range within this period, the timing element will be reset.
If the sensor value remains within the new range even after the period has
elapsed, the relevant light level will be activated.
This reduction of light flickering is effective only in automatic mode.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 26
4 Program Blocks for Tunnel Lighting Control

4.3.3 Description of the interface

The figure and table below show the call interface of the user function block
“Tunnel_Lighting_System” (FB 100).
Figure4-3
Copyright ã Siemens AG 2013 All rights reserved

Input parameters
The input parameters have the following meanings:
Table 4-8
Parameter Data type Note
LIGHT_SENSOR_OUTSIDE INT Analog value measured in Cd (lm/ser)
AUTO_MODE_ON BOOL Automatic mode
MANUAL_MODE_ON BOOL Manual mode
ACTUAL_SYS_DATE_TIME DATE_ Current system date and time
AND_TIME
Entry_EXIT_LIGHTLEV_1_MAN BOOL Entrance and exit light at level 1 in
manual mode
Entry_EXIT_LIGHTLEV_2_MAN BOOL Entrance and exit light at level 2 in
manual mode
Entry_EXIT_LIGHTLEV_3_MAN BOOL Entrance and exit light at level 3 in
manual mode
SET_ELAPSED_T_COUNTER_PV BOOL Reset of elapsed-time counter to 0
Set_VAL_Level_1 REAL Sensor limit value for level 1 in Cd
(lm/ser)
Set_VAL_Level_2 REAL Sensor limit value for level 2 in Cd
(lm/ser)

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 27
4 Program Blocks for Tunnel Lighting Control

Parameter Data type Note


Set_VAL_Level_3 REAL Sensor limit value for level 3 in Cd
(lm/ser)
Set_Sensor_MAX_VAL REAL Maximum sensor value in Cd (lm/ser)

Output parameters
The output parameters have the following meanings:
Table 4-9
Name of the variable Data type Note
ENTRY_LIGHT_1 BOOL Entrance light, level 1
ENTRY_LIGHT_2 BOOL Entrance light, level 2
ENTRY_LIGHT_3 BOOL Entrance light, level 3
EXIT_LIGHT_1 BOOL Exit light, level 1
EXIT_LIGHT_2 BOOL Exit light, level 2
EXIT_LIGHT_3 BOOL Exit light, level 3
TUNNEL_INSIDE_DAYLIGHT BOOL Interior light for the period
08:00-18:00
Copyright ã Siemens AG 2013 All rights reserved

TUNNEL_INSIDE_SUNUP_DOWN BOOL Interior light for the period


06:00-08:00 and 18:00-20:00
TUNNEL_INSIDE_NIGHTLIGHT BOOL Interior light for the period
20:00-06:00
ACTUAL_SYS_DATE DATE Current system date for visualization
on the local HMI panel
ACTUAL_SYS_TIME TIME_OF_ Current system time for visualization
DAY on the local HMI panel
ENTRY_EXIT_DAY_ON BOOL Daylight for entrance and exit zone
ENTRY_EXIT_SUNUP_DOWN_ON BOOL Evening and morning twilight for
entrance and exit zone
ENTRY_EXIT_NIGHT_ON BOOL Nightlight for the entrance and exit
zone
ELAPSED_TIME_COUNTER_VAL INT Current value of the elapsed-time
counter
AUTO_MODE BOOL Automatic mode activated
MANUAL_MODE BOOL Manual mode activated
SEN_PLAUSIBILITIY_CHECK BOOL Sensor plausibility check
=0: no fault, sensor OK
=1: failed
LIGHT_INTENSITY_SENSOR REAL Current light intensity value
measured by outside sensor in Cd
(lm/ser)

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 28
4 Program Blocks for Tunnel Lighting Control

4.4 Data block “SYS_DATA_HMI” (DB 101)


Description
The data block “SYS_DATA_HMI” is used to collect and store all information
required for visualization from the two function blocks.

Description of variables
The figure and table below show the variables of data block “SYS_DATA_HMI”
(DB 101).
Figure 4-4
Copyright ã Siemens AG 2013 All rights reserved

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 29
4 Program Blocks for Tunnel Lighting Control

The meaning of the variables is as follows:


Table 4-10
Variable Data type Note
Elapsed_Time_CounterVAL INT
SYS_Time TIME_OF_DAY Internal system time
SYS_DATE DATE Internal system date
AUTO_Mode BOOL Automatic mode activated
MANUAL_MODE BOOL Manual mode activated
Sen_Plausibility_Check BOOL Sensor plausibility check
=0: no fault, sensor OK
=1: failed
Entry_Light_1 BOOL Entrance light, level 1
Entry_Light_2 BOOL Entrance light, level 2
Entry_Light_3 BOOL Entrance light, level 3
EXIT_Light_1 BOOL Exit light, level 1
EXIT_Light_2 BOOL Exit light, level 2
EXIT_Light_3 BOOL Exit light, level 3
T_Inside_Day_Light BOOL Interior light for the period
Copyright ã Siemens AG 2013 All rights reserved

08:00-18:00
EXIT_ENTRY_DAYLIGHT_ BOOL Daylight for entrance and exit zone
ON
EXIT_ENTRY_NIGHTLIGHT BOOL Nightlight for entrance and exit zone
_ON
PLC_Rack_0_RUN_P BOOL CPU rack 0 in redundant mode
PLC_Rack_1_RUN_P BOOL CPU rack 1 in redundant mode
PLC_Rack_0_RUN_S BOOL CPU rack 0 in solo mode
PLC_Rack_1_RUN_S BOOL CPU rack 1 in solo mode
PLC_Rack_0_Stop BOOL CPU rack 0 in STOP mode
PLC_Rack_1_Stop BOOL CPU rack 1 in STOP mode
SYNC_Link_UP_01 BOOL Status of synchronization link-up 01:
Synchronization between CPU 0 and
CPU 1
=0: not possible
=1: possible
Fiber_Optic_Con_0 BOOL =0: no fault
=1: Fiber optics connection quality of
the synchronization modules in the
upper receptacle is limited
Fiber_Optic_Con_1 BOOL =0: no fault
=1: Fiber optics connection quality of
the synchronization modules in the
lower receptacle is limited
T_Inside_Night_Light BOOL Interior light for the period 20:00-06:00
T_Inside_SunUP_Dw_ON BOOL Interior light for the periods
06:00-08:00 and 18:00-20:00
EXIT_ENTRY_SunUP_Dw_ BOOL Evening and morning twilight for the
ON entrance and exit zone

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 30
4 Program Blocks for Tunnel Lighting Control

Variable Data type Note


RACK_0_MSTR BYTE H-status of CPU in rack 0
=0: standby CPU
=1: master CPU
RACK_1_MSTR BYTE H-status of CPU in rack 1
=0: standby CPU
=1: master CPU
Light_Intensity_Sensor REAL Current light intensity value
measured by the outside sensor in Cd
(lm/ser)
DT_date_and_time DATE_AND_TI Read system time and date
ME
Reserve1 WORD
Reserve2 WORD
Copyright ã Siemens AG 2013 All rights reserved

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 31
5 Configuration

5 Configuration
5.1 Address overview
The following figure illustrates the structure of the S7 project for the tunnel lighting
control system.
Figure 5-1

S7-400H S7-400H
„T_Control_Room1_PLC1“ „T_Control_Room2_PLC2“

HMI panel HMI panel


„Control_Room1_HMI1“ „Control_Room2_HMI2“
Copyright ã Siemens AG 2013 All rights reserved

ET 200M ET 200M

Control room 1 Control room 2

IP addresses
The modules are addressed as follows:
Table 5-1
Hardware Address Subnet mask
H-CPU_1 192.168.0.130 255.255.255.0
“T_Control_Room_1_PLC1”
H-CPU_2 192.168.0.131 255.255.255.0
“T_Control_Room_1_PLC2”
HMI Multipanel 192.168.0.3 255.255.255.0
“Control_Room_HMI_1”
HMI Multipanel 192.168.0.4 255.255.255.0
“Control_Room_HMI_2”

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 32
5 Configuration

Connection ID
Communication between the modules is realized by means of S7 connections. The
following table provides an overview:
Table 5-2
H-CPU_1 Control Center/T_Control_Room_1_PLC1
Local ID Partner ID Partner Type Active connection buildup
1 S7-connection_1 Control_Room_1_HMI S7 connection no
2 S7-connection_3 Control_Room_2_HMI S7 connection no
H-CPU_2 Control Center/T_Control_Room_2_PLC2
Local ID Partner ID Partner Type Active connection buildup
3 S7-connection_2 Control_Room_1_HMI S7 connection no
4 S7-connection_4 Control_Room_2_HMI S7 connection no

Table5-3
Control_Room_1_HMI
Local ID Partner ID Partner Type Active connection buildup
Copyright ã Siemens AG 2013 All rights reserved

S7-connection_1 1 T_Control_Room_1_PLC1 S7 connection yes


S7-connection_2 3 T_Control_Room_2_PLC2 S7 connection yes
Control_Room_2_HMI
Local ID Partner ID Partner Type Active connection buildup
S7-connection_3 2 T_Control_Room_1_PLC1 S7 connection yes
S7-connection_4 4 T_Control_Room_2_PLC2 S7 connection yes

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 33
5 Configuration

5.2 Information on the hardware configuration


The STEP 7 project supplied with the functional example of a tunnel lighting control
system as presented in this document also includes the hardware configuration
and the sample code.
For a better overview, the following chapter goes into some important STEP 7
hardware settings. Basically, these settings can be modified (e.g. to adapt the
system to individual requirements).

5.2.1 Settings for the H-CPUs

Table 5-4
No. Action Notes
1. Open a STEP 7 project in the SIMATIC
Manager. Select the H-system Tunnel and
open the hardware configuration dialog.
2. In the Properties dialog for the H-CPU you
can define the following properties:
· Definition of monitoring times:
– Max. scan cycle time extension
Copyright ã Siemens AG 2013 All rights reserved

– Max. communication delay


– Max. disabling time for
priority classes
– Min. I/O retention time
You may also click the “Calculate”
button to initiate automatic calculation
of the monitoring times.
· Allocation of the data block no. for the
redundant I/O. These two data blocks
are generated by the library
“Redundant IO” at runtime.

3. Select “Properties> PN-IO Interface” to


open a dialog where you can define the IP
addresses of the two CPUs:

CPU1: IP address:192.168.0.130,
subnet mask:225.225.225.0.
CPU2: IP address:192.168.0.131,
subnet mask:225.225.225.0.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 34
5 Configuration

Note The data block number for the redundant I/Os should not be used somewhere
else in the user program. Previous data blocks will be deleted and generated
anew.

Note For further information on H-system configuration, please refer to the following
manual: “SIMATIC Fault-tolerant systems S7-400H”, see \3\.

5.2.2 Configuration of the HMI panels

Table 5-5
No. Action Notes
1. Select the HMI station
“Control_Room_1_HMI” and
open the hardware configuration
dialog.
Select “Properties HMI IE>
General> Interface
Properties>Parameters” to open
a dialog where you can define
the IP address and the network:
Copyright ã Siemens AG 2013 All rights reserved

Control_Room_1_HMI:
IP address:192.168.0.3
Subnet mask:225.225.225.0
Control_Room_2_HMI:
IP address:192.168.0.4
Subnet mask:225.225.225.0

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 35
5 Configuration

5.2.3 Defining the I/O redundancy

The term ‘redundant I/Os” refers to input/output modules which are available in
twofold and redundantly configured and operated in pairs. The redundancy mode is
defined in the Properties dialog of the signal modules.
Table 5-6
No. Action Notes
1. Open the Properties dialog for
the signal module “SM322 DO16
24 V / 0.5 A” and select the
“Redundancy tab” where you
can define the redundant mode
settings.

If “2 modules” is selected in the


redundancy settings, all possible
redundant modules in other
ET200M stations of the same
type will be listed automatically.

Click the “Find” button to display


Copyright ã Siemens AG 2013 All rights reserved

all modules of the same type in


the redundant Profibus
networks.

Note A current list of modules suitable for redundant operation can be found in the
following system manual:
“Fault-tolerant system S7-400H“, chapter “Signal modules for redundancy”,
see \3\.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 36
5 Configuration

5.2.4 Configuration of the S7 connection

To enable communication between the HMI panel and the H-CPUs, the relevant
S7 connections are to be created in NetPro.
Table 5-7
No. Action Notes
2. To add a new connection, first
select CPU 1. Use your right
mouse button or the shortcut
Ctrl+N to add a new connection.
Now select the connection type
"S7 connection” and confirm
your selection with OK.

3. The Properties dialog for the S7


Copyright ã Siemens AG 2013 All rights reserved

connection shows the local and


the partner address.
After a click on the OK button,
the configured connection will be
shown in the table.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 37
5 Configuration

No. Action Notes


4. After having configured all
connections, click “Ethernet(1)”
so that all connections will be
shown in the lower connection
table.
Compile the network
configuration and download it to
the controller.
Copyright ã Siemens AG 2013 All rights reserved

5.3 Configuration instructions for the HMI panel


5.3.1 Connection to the H station

An HMI panel can be connected directly to a SIMATIC H station only, if the H-


CPUs have different IP addresses. As this requirement is met in this application
example, the HMI panel can be used for visualization and control.
Each control room is provided with its own HMI panel which shall always be
available for operator control and monitoring even after a switchover between
master and standby station.
This is effected by the internal system function “WechseleVerbindung” in
combination with the status analysis of the H-CPUs.
If the SIMATIC H-station identifies the failure of an H-CPU, the
“WechseleVerbindung” function will build up a connection to the other H-CPU.
The “WechseleVerbindung” function terminates the connection to the PLC currently
in use and establishes a new connection with the specified controller.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 38
5 Configuration

5.3.2 Connections in WinCC flexible

Configuration of connections
The HMI panels are connected with the two H-CPUs via Industrial Ethernet. To
enable the exchange of variables between these components, the relevant
connections must be specified in WinCC flexible.
· S7-connection_1 or S7-connection_3 is connected to the first H-CPU
(T_Control_Room_1_PLC1) via Industrial Ethernet.
· S7-connection_2 or S7-connection_4 is connected to the second H-CPU
(T_Control_Room_2_PLC2) via Industrial Ethernet.
· Control_Raum_1_PLC_Changer_12 and/or
Control_Raum_2_PLC_Changer_12 has been connected “manually” to an
S7-300/400 unit via Industrial Ethernet and provides an auxiliary connection
for the “WechseleVerbindung” function.
Figure 5-2
Copyright ã Siemens AG 2013 All rights reserved

Note Please make sure to enter the receptacle and slot numbers correctly.

5.3.3 The system function “WechseleVerbindung”

With the help of the internal system function “WechseleVerbindung” and the status
analysis of the H-CPUs, a connection to the active H-CPU will be established,
depending on the operating mode of the CPU.

Creation of variables
For the status analysis of the H-CPUs, one variable for each H-CPU must be
created in WinCC flexible (“Rack_x_PLC_x_Master”) and referenced to the
corresponding status variable in the data block "SYS_DATA_HMI". In concrete
terms, this means:
· “Rack_0_PLC_1_Master” è Tag “RACK_0_MSTR” in DB 101 (DB101.DBB11)
· “Rack_1_PLC_2_Master” è Tag “RACK_1_MSTR” in DB 101 (DB101.DBB12)
These data block variables may show the following values:
· =0: CPU presently used as standby station
· =1: CPU defined as master.
In WinCC flexible, the acquisition type “cyclic continuous” is selected.
Figure 5-3

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 39
5 Configuration

Configuration of variables
In the Properties dialog for the WinCC tag “Rack_x_PLC_x_Master”, an upper limit
value of “0” is defined in combination with the event parameter “High limit
exceeded” and the function “ChangeConnection”. As “Connection” partner, the
auxiliary connection “Control_Room_x_PLC_Changer_12” is selected.
The addresses, slots and racks correspond to the connection parameters.
Figure 5-4

Function principle
Initial situation: The first CPU (T_Control_Room_1_PLC_1) is the master CPU; the
Copyright ã Siemens AG 2013 All rights reserved

associated H-status in DB101.DB11 shows the value "1".


In WinCC flexible, the upper limit value of the variable “DB101.DBB11” is analyzed
(limit value “0”). The “limit value” is exceeded (Master = “1”) and the
"ChangeConnection" function is executed.
The panel terminates the connection “Control_Room_1_PLC_Change_12” and
changes over to the configured connection parameters of S7-connection_1.
Connection to the CPU is built up.

Initial situation: The second CPU (T_Control_Room_2_PLC_2) is the master CPU;


the associated H-status in DB101.DB12 shows the value “1”.
In WinCC flexible, the upper limit value of the variable “DB101.DBB12” is analyzed
(limit value “0”). The “limit value” is exceeded and the “ChangeConnection” function
is executed.
The panel terminates the connection “Control_Room_2_PLC_Change_12” and
changes over to the configured connection parameters of S7-connection_2.
Connection to the CPU is built up.

Note A detailed description of how to connect a panel with a SIMATIC H-station is


available under the entry ID: 23842653, see \6\

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 40
6 Installation

6 Installation
The following chapter describes all steps required to put the sample project into
service on the basis of this application example and the hardware list.

6.1 Hardware and software installation


Hardware structure of the H-stations
The figure below shows the hardware structure of the application.
Figure 6-1

S7-400H S7-400H

HMI panel HMI panel

SCALANCE SCALANCE
X208 X208
Copyright ã Siemens AG 2013 All rights reserved

ET 200M ET 200M

Control room 1 Control room 2


Both control rooms are equipped with identical hardware components:
· H-CPU 416-5H
· PS 407
· HMI panel
· SCALANCE X208
· ET 200M (for redundant operation) with two IMs and one DO.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 41
6 Installation

Proceed as follows for hardware installation and connection in the control rooms:
Table6-1
No. Action Notes
1. Mount the individual modules to a suitable See HW configuration
module rack.
2. Connect the PS307 for ET 200M and the PS 407 Take note of correct polarity.
for the H-CPUs to power (230 V AC).
3. Use the power supply modules to supply the
other modules with 24V DC.
4. Connect the following devices with the The Engineering-PG is used to load the
SCALANCE X208: controller and the HMI panel in the control
· PROFINET interface of the CPU room.
Depending on the controller or HMI panel to
· PROFINET interface of the HMI panels be loaded, the PC will be connected with the
· PROFINET interface of the Engineering PG relevant X208 of the control room.

5. Connect an IM of the ET200M with the CPU via


PROFIBUS. The following assignments apply:
· Control room 1: IM1 with H-CPU1
· Control room 2: IM2 with H-CPU2
Interconnect the two control rooms as follows:
Table6-2
Copyright ã Siemens AG 2013 All rights reserved

Nor. Action Notes


1. Connect the two SCALANCE X208 units.
2. Produce further connections to the IMs of the Connection of the redundant I/Os to the H-
ET 200M via PROFIBUS. system is effected in the defined DP slave
The following assignments apply: mode. This means that both master and
· Control room 1: IM2 with H-CPU2 standby station are connected with the two
· Control room 2: IM1 with H-CPU1 ET 200M stations.
3. Interconnect the H-CPUs via fiber optics cables.

Note The guidelines for the installation and setup of components are to be observed.
Please refer to the corresponding device manuals.

NOTICE Connect the system to power only after having completed and checked all
installation and setup work!

Software installation
The Engineering station is used as a configuration calculator for the S7 station. The
following software components must be installed.
Table 6-3
No. Action Notes
1.. Install STEP 7 Follow the instructions of the installation
program.
2. Install WinCC Flexible Follow the instructions of the installation
program.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 42
6 Installation

Installation of the sample project


The following table shows all steps required for the installation of the sample code.
Table 6-4
No. Action
1. The project is available on the same HTML site from where you have downloaded this document.
Save the project “[Entry-ID]_CODE_v10.zip” on your harddisk.
2. Open the SIMATIC Manager and select the menu commands “File >Retrieve“ and select the zip-
file. Follow the instructions for installation.

6.2 PC and controller configuration


Configure the PG / PC interface
Table 6-5
No. Action Display
1. In the SIMATIC MANAGER, select
“Options>Set PC/PG Interface” and set the PC
interface to the TCP/IP interface.
Copyright ã Siemens AG 2013 All rights reserved

2. Define the access point. Select the network


card used for the TCP/IP protocol. Click “OK”
to confirm your settings.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 43
6 Installation

Change the IP address


The figure below shows the network settings to be changed for the PG/PC.
Table 6-6
No. Action Display
1. Select “Start > Settings >NetworkConnection >
Local Connections” to open the Properties
dialog for the Internet Protocol (TCP/IP).
In this dialog, select the internet protocol
(TCP/IP) and open the Properties dialog.

Activate the radio button “Use following IP-


address” and fill in the field as shown in the
screenshot. Click “OK” to close the dialog
again.
Copyright ã Siemens AG 2013 All rights reserved

2. If your PG is provided with an IWLAN


interface, it must be disabled.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 44
6 Installation

Change the IP address of the CPU


Before you can download the STEP 7 project to your CPU, the IP address of the
H-CPU must be changed as shown in Table 4-1.
Connect the Engineering PC with the corresponding SCALANCE X208.
Table 6-7
No. Action Display
1. Open the SIMATIC Manager and select the
STEP 7 project.
2. Select “Edit Ethernet Node…” from the “PLC”
menu list.
Copyright ã Siemens AG 2013 All rights reserved

3. Click the “Browse…“ button.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 45
6 Installation

No. Action Display


4. Select the desired module and confirm your
selection with “OK”.

5. In the “Set IP configurations” field in the next


dialog, enter the IP address as described in
the chapter on H-CPU configuration.
Click the button “Assign IP Configuration”.
Then click the “Close” button to close the
dialog window.
Copyright ã Siemens AG 2013 All rights reserved

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 46
6 Installation

Set the clock time


When using the tunnel application it is important that the controller knows the
current clock time. Proceed as follows to set the clock in the CPU:
Table 6-8
No. Action Display
1. Open the SIMATIC Manager and select the
STEP 7 project.
2. Select the first CPU
(T_Control_Room_1_PLC_1). Select the CPU
menu commands “PLC > Set Time of Day” to
open a dialog where the clock time can be
defined.
You can either use the clock time from the
PG/PC or enter another value manually. Click
the “Apply” button to transfer the clock time
information to the PLC.
Copyright ã Siemens AG 2013 All rights reserved

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 47
6 Installation

6.3 Download of project data


Download the STEP 7 project
In an H-system, the project data is downloaded only to the first CPU. The partner
CPU will then be synchronized automatically.
Connect your Engineering PC with the SCALANCE X208 of control room 1.
Table 6-9
No. Action Display
1. Open the HW configuration dialog for the H-
system.
Select the first H-CPU
(T_Control_Room_1_PLC_1) and download
the HW configuration in STOP mode to this
CPU.

Click the “OK” button to start downloading of


the HW configuration.
Copyright ã Siemens AG 2013 All rights reserved

2. Open the SIMATIC Manager and download


the STEP 7 program from there to the first H-
CPU (T_Control_Room_1_PLC_1). To do so,
select the block container and click
“PLC>Download”.

3. Set the H-CPU (T_Control_Room_1_PLC_1),


which is currently in solo mode, to RUN mode.

The redundant mode will become effective


after startup of the second H-CPU
(T_Control_Room_2_PLC_2), connection and
updating process.
Select the first H-CPU
(T_Control_Room_1_PLC_1) to check the
mode of operation. The status can be checked
by selecting “PLC > Operating mode” from the
CPU context menu.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 48
6 Installation

Download the WinCC flexible project


To enable operation of the project via the operator control devices
(Control_Room_1_HMI and Control_Room_2_HMI), the project data must be
transmitted. Connect the Engineering PC with the corresponding SCALANCE
X208.
Proceed as follows to download the WinCC project to the operator control device
(in this example to the HMI panels in control room 1; download to the other HMI
panel is performed analogously):
Table 6-10
No. Action Display
1. Open the SIMATIC Manager and select
“Control_Room_1_HMI > WinCC flexible RT”
using the “Open object” command or with a
double-click.
Copyright ã Siemens AG 2013 All rights reserved

2. Select “Project > Transfer > Transfer…” to


define the settings for data transfer.
Select Ethernet mode and enter the IP
address of the HMI panel. Use the Transfer
button to start the transmission of the project
to the operator control device.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 49
7 Operation of the Application

7 Operation of the Application


Overview
Prerequisite for the operation of the sample project is that the H-system, as well as
the HMI panels and the sample project have been loaded.
The sample project is operated via the HMI panel. Only the light intensity values for
sensor simulation are entered directly into the variables table “VAT_1”.
This interaction is illustrated in the following figure:
Figure 7-1

or
Copyright ã Siemens AG 2013 All rights reserved

Note The light intensity value is entered via the variables table VAT_1:
0 – 27648 corresponds to a light intensity of 0 – 100.000 Cd (lm/ser).

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 50
7 Operation of the Application

Log in and log out at the panel


Table 7-1
No. Action Display
1. Before you start operating the HMI panel, you
must first log in with the following access data:
User: “Admin”
Password: “siemens”

After successful registration, the name of the


logged-in user will be shown.
Use the “Log out” button, if you wish to quit.
With the “Runtime OFF” button you can close
the Runtime program.

Define the sensor limit values via the HMI


Table 7-2
Copyright ã Siemens AG 2013 All rights reserved

No. Action Display


1. Click the button SENSOR SET VALUES to
open a dialog where the sensor limit values
can be defined.

Enter the following limit values:


Set Sensor Maximum Value = 100.000,00 Cd.
Set Value Level 3= 66666,67Cd.
Set Value Level 2 = 33333,34Cd.
Set Value Level 1 = 0,00 Cd.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 51
7 Operation of the Application

Switchover between operating modes


Table 7-3
No. Action Display
1. Click the button AUTO-MODE to activate the
automatic mode.

The automatic mode will be reset, as soon as


manual mode (MAN-Mode) is selected and
one of the following inputs is activated:
ENTRY_EXIT_LIGHTLEV1_MAN;
ENTRY_EXIT_LIGHTLEV2_MAN;
ENTRY_EXIT_LIGHTLEV3_MAN.
Copyright ã Siemens AG 2013 All rights reserved

Reset the elapsed-time counter of the CPU


Table 7-4
No. Action Display
1. Here you can set the elapsed-time counter of
the CPU to 0.
You may also define a CPU-specific number
for the elapsed-time counter.
The output field shows the current value of the
CPU’s elapsed-time counter.

Note If the elapsed-time counter exceeds 32767 hours, it will stop and the SFC 4
“READ_RTM” will show the error message “Overflow”.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 52
7 Operation of the Application

Define the light intensity value


Table 7-5
No. Action Displays
1. Open the variables table “VAT_1” and activate
the monitoring mode (Strg+F7 or ).

Change this value in a range between


0..27648 which corresponds to a light intensity
of 0..100.000Cd (lm/ser).

The specified value can then be transferred to


the PLC by pressing the shortcut keys Ctrl+F9
or clicking the icon .

Simulate reaction to an error


For the period between 8:00 and 18:00 the light sensor shall show a value between
Set_Val_Lev3 (66666,67) and Set_Sensor_Max_Val (100000), as expected.
Copyright ã Siemens AG 2013 All rights reserved

If a defect or environmental influences (e.g. fog) lead to an incorrect measuring


result, e.g. a value smaller than Set_Val_Lev3, an error reaction will be simulated
on the HMI.
Table 7-6
No. Action Display
1. We assume that the current CPU time is
14:00. Light level 3 is activated and the
plausibility check does not show any problems
(i.e. the measured light intensity complies with
the time of day).
Enter a light intensity value of 65104,17 Cd
(integer number 18000) in the variables table
VAT_1 and transfer this value to the PLC.
The light intensity value of 65104,17 Cd is no
longer within the expected range between
Set_Val_Lev3 (66666,67) and
Set_Sensor_Max_Val (100000), but in a range
for light level 2.

Since a plausibility check indicates an


incorrect measuring result (time of day and
measured light intensity do not match), the
following message will appear on the HMI after
a time T=1min (hysteresis time to avoid light
flickering):

“Sensor plausibility check failed, please check


the outside sensor”.

Daylight illumination and light level 3 will be


activated for the entrance and exit zones.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 53
7 Operation of the Application

H-system status: H-system in solo mode


Table 7-7
No. Action Display
1. The HMI shows the status of the fault-tolerant
system.
If a hardware error occurs, one H-CPU
changes over to STOP mode and the H-
system is no longer in redundant mode.
Set the master H-CPU to STOP mode.
The system will switchover from the master to
the standby CPU. The previous master H-CPU
becomes the standby CPU and remains in
STOP mode, whereas the new master H-CPU
takes over the control functions.

H-system status: Synchronization cable disconnection


Table 7-8
No. Action Display
1. Any disconnection of the synchronization cable
Copyright ã Siemens AG 2013 All rights reserved

between the two H-CPUs is indicated on the


HMI. The standby H-CPU will turn into a fault
locating mode (RUN and STOP LEDs start
flashing at a frequency of 0,5 Hz) and the H-
system is no longer in redundant mode.

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 54
8 Related literature

8 Related literature
Table 8-1
Topic Title / Link
\1\ Siemens Industry http://support.automation.siemens.com
Online Support
\2\ Download page of http://support.automation.siemens.com/WW/view/81066268
this entry
\3\ Fault-tolerant http://support.automation.siemens.com/WW/view/en/60458386
systems
S7-400H
\4\ WinCC flexible WinCC flexible 2008 Communication Part 1
2008 http://support.automation.siemens.com/WW/view/en/18797552
\5\ System and http://support.automation.siemens.com/WW/view/en/44240604
Standard
Functions for S7-
300/400 Volume
1/2.
\6\ How do you http://support.automation.siemens.com/WW/view/en/23842653
connect a panel
to a SIMATIC H
Copyright ã Siemens AG 2013 All rights reserved

station?
/7/ Step 7 Automating with STEP7 in STL and SCL
Author: Hans Berger
Publicis Publishing
ISBN 3895783242
/8/ SPC automation Automatisieren mit SPS – Theorie und Praxis
[Automating with PLC – Theory and Practice]
Authors: Günter Wellenreuther \ Dieter Zastrow
Publicis Publishing
ISBN 9783834802316

9 History
Table 9-1
Version Date Modifications
V1.0 10/2013 First version

Tunnel Lightning System


Item-ID: 81066268, Version 1.0, 10/2013 55

You might also like