You are on page 1of 27

Application for Process Automation

Audible Alarms for PCS 7 Web Clients

Application Note
Warranty, liability and support

Audible Alarms for PCS 7 Web Clients 29088810

NOTE The application examples are not binding and do not claim to be com-
plete 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 re-
sponsible in ensuring that the described products are correctly used.
These application examples do not relieve you of the responsibility in
safely and professionally using, installing, operating and servicing equip-
ment. When using these application examples, you recognize that Sie-
mens cannot be made liable for any damage/claims beyond the liability
clause described. We reserve the right to make changes to these applica-
tion 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 - then the contents of the
other documents have priority.

Warranty, liability and support


Copyright  Siemens AG 2007 All rights reserved

We do not accept any liability for the information contained in this docu-
ment.
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 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 condi-
tion which goes to the root of the contract (“wesentliche Vertragspflichten”).
However, claims arising from a breach of a condition which goes to the root
of the contract shall be limited to the foreseeable damage which is intrinsic
to the contract, unless caused by intent or gross negligence or based on
mandatory liability for injury of life, body or health. The above provisions do
not imply a change in the burden of proof to your detriment though.
Copyright© 2008 Siemens A&D. It is not permissible to transfer or
copy these application examples or excerpts of them without first
having prior authorization from Siemens A&D in writing.
For questions about this document please use the following e-mail address:
mailto:online-support.automation@siemens.com

Version V1.0 21.04.2008 2/27


Preface

Audible Alarms for PCS 7 Web Clients 29088810

Preface
Objective of the application
This applicative solution has been created in response to customer needs
for audible alarms on the PCS 7 Web clients.
Audible alarms are a feature of the PCS 7 OS environment but are not
available to the Web clients as a standard feature.

Main contents of this application


This application deals with the following key elements:
• Ready-made C-scripts for downloading and implementation
(e.g. Windows API called on the Web client to produce sounds)
• Step-by-step configuration instructions

Validity
This application is valid starting from PCS 7 V7.0 SP1.
Copyright  Siemens AG 2007 All rights reserved

Reference to Automation & Drives Service & Support


This entry is from the internet application portal of Automation and Drives
Service & Support. Clicking the link below directly displays the download
page of this document.
http://support.automation.siemens.com/WW/view/en/29088810

Version V1.0 21.04.2008 3/27


Table of Contents

Audible Alarms for PCS 7 Web Clients 29088810

Table of Contents

Table of Contents ....................................................................................................... 4


1 Introduction ................................................................................................... 5
1.1 Application Description .................................................................................... 5
1.2 Functional principle ......................................................................................... 6
2 Configuration ................................................................................................ 8
2.1 Basic functionality for the sound output ........................................................... 8
2.1.1 Provision of a sound file .................................................................................. 8
2.1.2 Creation of an internal signal tag ..................................................................... 9
2.1.3 Configure the WinCC editor "Horn" ............................................................... 10
2.1.4 Integration of the audio function "Sound.fct" .................................................. 12
2.1.5 Adaptation of the system picture "@AlarmOneLine.PDL" .............................. 13
2.1.6 Publishing and testing the Web function ........................................................ 19
Copyright  Siemens AG 2007 All rights reserved

2.2 Cyclic sound replay ....................................................................................... 21


2.2.1 Creation of an additional toggle tag ............................................................... 21
2.2.2 Integration of the global action "SoundCycle.pas" ......................................... 21
2.2.3 Adaptation of the system picture "@AlarmOneLine.PDL" .............................. 24
3 Expansion options ...................................................................................... 25
3.1 Configuration of different sounds ................................................................... 25
3.2 Sound acknowledgement .............................................................................. 27

Version V1.0 21.04.2008 4/27


Introduction

Audible Alarms for PCS 7 Web Clients 29088810

1 Introduction
1.1 Application Description

This document describes how the OS project of a PCS 7 Web server can
be modified so that an acoustic signalling is created on the Web clients as
a reaction to selected messages.

Figure 1-1

Acoustic signalling
Copyright  Siemens AG 2008 All rights reserved

Event/message

The necessary C-scripts are provided in the documentation and in addition


for downloading.
To provide the acoustic signal feature the following main steps have to be
carried out in the Web server project:

1. Configuration of the horn editor (selection of messages)


2. Implementation of a C-script as project function to create the audio
function on the Web client
3. Modification of a system picture to monitor the message status and to
trigger the audio function when a respective message has been re-
ceived and has not been acknowledged yet
4. Publishing of the added Web functions
5. Optional expansion through a C-action which permits the cyclic replay-
ing of the sound file

Version V1.0 21.04.2008 5/27


Introduction

Audible Alarms for PCS 7 Web Clients 29088810

1.2 Functional principle

Note The acoustic signal output in the standard PCS 7 OS environment is in-
dependent of the Web client applicative solution.

Basic functionality
When a message is obtained with the desired characteristic (e.g. alarm or
warning), the default horn functionality of the PCS 7 OS (Web server) will
set the value of an allocated internal binary signal tag to '1'.
To trigger the sound replay on the Web client, the respective program call
is integrated into a system picture which is permanently visible in the pro-
cess visualization in Internet Explorer and which is, thus, active. The sys-
tem picture "@AlarmOneLine" is used for this.
An I/O field is interconnected with the signal tag in such a way that upon a
state change from '0' to '1' a script is running which replays the configured
Copyright  Siemens AG 2008 All rights reserved

sound file.

Expansion for cyclic sound repetition


In the case of the acoustic signal output in the standard PCS 7 OS envi-
ronment the sound is permanently replayed in the unacknowledged state of
a message. This functionality is not available like this on the Web client.
The sound is rung just once.
To replay the sound file repeatedly a separate binary toggle tag is used on
the Web server. This tag has to be interconnected with the above I/O field
and it calls the script for sound replay (audio function) upon every state
change.
Similarly on the Web server a cyclic action is required which polls the state
of the signal tag (one or several) and which changes the state of the toggle
tag as long as a relevant event (message) is pending. The interval of this
action can be set according to the length of the sound file/s.

Note To replay different sound files with severely differing lengths, several cy-
clic actions can be used with different intervals and different toggle tags.

Version V1.0 21.04.2008 6/27


Introduction

Audible Alarms for PCS 7 Web Clients 29088810

Acknowledgement behaviour
The acknowledgement behaviour for the acoustic signal output of the
standard PCS 7 OS environment also differs from that of the Web client
applicative solution.
On the one hand it is possible on the Web client and likewise in the stand-
ard PCS 7 OS environment to acknowledge the actual message. This stops
the acoustic signal output both at the Web client and in the standard sys-
tem.
In the standard system the "Acknowledge horn" button serves to switch off
only the acoustic signal. This functionality is not available for the Web cli-
ent.
For an applicative approach of realizing this refer to the chapter 3.2 "Sound
acknowledgement".
Copyright  Siemens AG 2008 All rights reserved

Version V1.0 21.04.2008 7/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2 Configuration
The entire configuration is carried out on the Web server or on the ES in
the Web server project which is downloaded to the Web server computer
afterwards.

2.1 Basic functionality for the sound output

The following description refers to the allocation of a sound file to one or


even several message types (message class, priority, source, etc.).
The chapter 3.1 "Configuration of different sounds" shows how different
sounds can be output for different message types.

2.1.1 Provision of a sound file

Three different sound files are stored by default in the subdirectory "Horn"
in the PCS 7 project.
Copyright  Siemens AG 2008 All rights reserved

Figure 2-1

If you wish to use user-specific sound files you should store them here too.

Note The desired sound file could also be provided locally on the Web client.
This is not recommended though because you would have to make sure
that the sound files are stored in the same location on all Web clients.
If the sound files are located on the Web server no further activities are
required on the Web clients.

Version V1.0 21.04.2008 8/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.1.2 Creation of an internal signal tag

The Web server project is opened in the WinCC Explorer.


Create a new binary tag in the group "Horn" of the internal tags. Designate
it, for instance, "Sound_tag".

Figure 2-2
Copyright  Siemens AG 2008 All rights reserved

Version V1.0 21.04.2008 9/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.1.3 Configure the WinCC editor "Horn"

The Web server project is opened in the WinCC Explorer.


Via "Horn" open the Horn Editor and the tab "Message assignment" there.
With the help of the columns "Message class" to "Event" select the desired
message type and assign the signal tag "Sound_tag" in the column "Tag".

Figure 2-3
Copyright  Siemens AG 2008 All rights reserved

Note The tab "Signal assignment" is of interest only for the configuration for the
standard PCS 7 environment. It does not have any importance for the
Web functionality.

Close the dialog with the "OK" button.


By the assignment in our example the tag "Sound_tag" will be set to '1' on
every coming warning.

Version V1.0 21.04.2008 10/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

One sound for several message types


Proceed in the same way if the same sound is to be replayed in the case of
different messages.

Figure 2-4
Copyright  Siemens AG 2008 All rights reserved

Different sounds for different message types


The configuration of different signal tags for the replaying of different sound
files is not dealt with in this part of the documentation on the provision of
the basic functionality.
Such a solution needs adaptation of the scripts. Refer to the chapter 3.1
"Configuration of different sounds" for the respective descriptions.

Version V1.0 21.04.2008 11/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.1.4 Integration of the audio function "Sound.fct"

In the following a project function is created which calls the Windows API
for the purpose of replaying a *.wav file.

Integration of the function in Windows Explorer


In Windows Explorer copy the file "Sound.fct" to the subdirectory "library" of
the Web server project.

Figure 2-5
Copyright  Siemens AG 2008 All rights reserved

Introduction of the function in WinCC


With the Web server project open go back to the WinCC Explorer then.
Under "Global Script" open the "C-Editor" here and check whether the pro-
ject function is displayed. Regenerate the headers via "Options > Re-
generate Header" or via the respective button.

Figure 2-6

Version V1.0 21.04.2008 12/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.1.5 Adaptation of the system picture "@AlarmOneLine.PDL"

The system picture "@AlarmOneLine" is permanently visible in the process


visualization of the Web client. With the help of an I/O field a script is in-
stalled which monitors the signal tag. If it changes to the value '1', i.e. the
event which has been configured in the "Horn" editor has occurred (mes-
sage), the project function "Sound.fct" is called which replays the desired
sound file then.

Opening the picture in the Graphics Designer


The Web server project is opened in the WinCC Explorer.
Under "Graphics Designer" select the system picture
"@AlarmOneLine.PDL" and open it.

Figure 2-7
Copyright  Siemens AG 2008 All rights reserved

Note Other picture elements would also be suitable as long as they stay visible
on the screen.

Version V1.0 21.04.2008 13/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Adding an I/O field


From the group "Smart Objects" of the object palette place an I/O field be-
low the alarm control. This area of the picture will not be visible during the
process visualization later.

Figure 2-8
Copyright  Siemens AG 2008 All rights reserved

After that the configuration window for the I/O field appears.
Configure the signal tag "Sound_tag" in the field "Tag". In the area "Type"
select the field "Output".

Figure 2-9

Version V1.0 21.04.2008 14/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Save and close the dialog field with "OK".


Open the properties dialog of the I/O field then. The parameterization in the
"Object Properties" tab should look like this now:

Figure 2-10
Copyright  Siemens AG 2008 All rights reserved

Version V1.0 21.04.2008 15/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Integration of the C-Action


In the "Event" tab select the attribute "Output Value" in the left pane. In the
right pane configure a C-Action for the event "Change".

Figure 2-11
Copyright  Siemens AG 2008 All rights reserved

The editor "Edit Action" is opened. Add the following action here:

#ifdef RUN_ON_WEBNAVIGATOR

Sound("\\\\Servername\\OS_ProjectName\\SoundfileFolder\\Soundfile",0);

#endif

Version V1.0 21.04.2008 16/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Note If the sound file is located locally on the Web client, the string will change
in the function call of "Sound.fct" accordingly.
(e.g. Sound("D:\SoundfileFolder\\Soundfile",0);

Use the following parameters:


Table 2-1
Parameter Comment
Servername DNS name or IP address of the Web server (in this case "IIWebserver")
OS_ProjectName Windows-Share name of the Web server project
(in this case "WinCC60_Project_OS(11)"
SoundfileFolder Subdirectory in the Web server project which contains the sound file (in
this case "Horn")
Soundfile File name of the sound file (in this case "Horn_Danger")
Copyright  Siemens AG 2008 All rights reserved

The script should look like this then:

Figure 2-12

After you have input the program code, compile the script with the button
and close the editor with "OK".
Store your settings in the "Graphics Designer".

Version V1.0 21.04.2008 17/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Protection of the changes


Make sure that the checkbox in front of "@AlarmOneLine" in the tab "Basic
data" of the OS project editor has not been selected to prevent that chang-
es are overwritten when the OS project editor is executed next time.

Figure 2-13
Copyright  Siemens AG 2008 All rights reserved

Close the OS project editor with the "OK" button.

Version V1.0 21.04.2008 18/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.1.6 Publishing and testing the Web function

Note We assume that the Web server has been set up already.
If this is not the case install and configure the Web server and publish the
graphics and scripts as described in the manual "PCS 7 OS Web Option".
A download of the manual can be obtained via the following URL:
http://support.automation.siemens.com/WW/view/en/21405795

To complete the changes to the Web client both the picture element
"@AlarmOneLine.PDL" and the audio function "sound.fct" have to be pub-
lished for the Web (anew).
For this purpose execute the "Web View Publisher" which is located below
the item "Web Navigator" in the WinCC Explorer.
Copyright  Siemens AG 2008 All rights reserved

Figure 2-14

Version V1.0 21.04.2008 19/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Figure 2-15
Copyright  Siemens AG 2008 All rights reserved

Finish the publishing process.

Note If you have executed the configuration in the Web server project on an
ES you will have to transfer the changes to the Web server PC by project
download in addition.

The basic functionality should have been set up now.


If a message which has been configured accordingly is obtained the allo-
cated sound file will be replayed on the Web client.
To repeat the sound replay cyclically as long as the message is
unacknowledged follow the description in the following chapter.

Version V1.0 21.04.2008 20/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.2 Cyclic sound replay

This configuration is also performed on the Web server or on the ES in the


Web server project.
In order that a sound can be replayed continuously on the Web client, the
replaying of the *.wav file has to be retriggered periodically.
This is achieved by having the value of a binary tag cyclically inverted (in
this case "Sound_cycle"). This tag will trigger the script for sound replay
then as long as the message remains unacknowledged.

2.2.1 Creation of an additional toggle tag

The Web server project is opened in the WinCC Explorer.


Create an additional binary tag in the group "Horn" of the internal tags.
Designate this tag, for instance, "Sound_cycle".
Copyright  Siemens AG 2008 All rights reserved

Figure 2-16

2.2.2 Integration of the global action "SoundCycle.pas"

Next a global action has to be defined which cyclically inverts the toggle tag
as long as the signal tag which has been configured in the "Horn" editor
remains set.

Version V1.0 21.04.2008 21/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Integration of the action in Windows Explorer


In Windows Explorer copy the file "SoundCycle.pas" to the subdirectory
"PAS" of the Web server project.

Figure 2-17
Copyright  Siemens AG 2008 All rights reserved

Introduction of the function in WinCC


With the Web server project open go back to the WinCC Explorer then.
Under "Global Script" open the "C-Editor" here and check whether the
global action is displayed. Regenerate the headers via "Options → Re-
generate Header" or via the respective button.

Figure 2-18

If required adapt the tag names in the C-script to your configuration.

Version V1.0 21.04.2008 22/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

Determining the trigger


A cyclic trigger must be defined for the execution of the global action
"SoundCycle.pas".
A repetition rate of 5 seconds should be sufficient for our purpose. But the
value may also be adapted to the length of the sound.

Note Note, however, that generally many fast cyclic triggers can impair the
performance of the OS system.

In the Global Script Editor click the trigger symbol or via the menu
"Edit > info" select the tab "Trigger".
Via "Add" add a cyclic trigger of 5 seconds, for instance.
Copyright  Siemens AG 2008 All rights reserved

Figure 2-19

Close the dialog window with "OK".


Save and close the Global Script Editor.

Version V1.0 21.04.2008 23/27


Configuration

Audible Alarms for PCS 7 Web Clients 29088810

2.2.3 Adaptation of the system picture "@AlarmOneLine.PDL"

In the "Graphics Designer" open the system picture


"@AlarmOneLine.PDL".
Select the existing I/O field and open the configuration dialog.
Substitute the signal tag "Sound_tag" in the field "Tag" by the created tog-
gle tag "Sound_cycle".

Figure 2-20
Copyright  Siemens AG 2008 All rights reserved

Close the dialog with the "OK" button.


The script function which is linked with the I/O field remains unchanged.
Store your settings in the "Graphics Designer".
To make the changed functionality available for the Web perform another
publishing action (see chapter 2.1.6 "Publishing and testing the Web func-
tion").

Version V1.0 21.04.2008 24/27


Expansion options

Audible Alarms for PCS 7 Web Clients 29088810

3 Expansion options
In the following you will find proposals for potential function expansions.
The description will not be detailed though.

3.1 Configuration of different sounds

To replay different sounds for different message types several adaptations


have to be made:
• Creation of a signal tag for every sound
• Expanding the configuration in the "Horn" editor
• Expanding the global action "SoundCycle.pas"
• Expanding the C-action in the picture "@AlarmOneLine.PDL"
A separate signal tag is allocated to every sound.
Provide the desired sound files and corresponding signal tags for this (see
Copyright  Siemens AG 2008 All rights reserved

chapters 2.1.1 and 2.1.2).

Adaptation of the "Horn" configuration

Figure 3-1

In this example the message types "Warning", "Alarm" and "PLC process
control messages" are allocated to the tags Sound_tag1-3 to allow creating
three different acoustic signals on the Web client.

Version V1.0 21.04.2008 25/27


Expansion options

Audible Alarms for PCS 7 Web Clients 29088810

Expanding the global action "SoundCycle.pas"


Add an OR function of the signal tag polling to the existing action
"SoundCycle.pas":

Figure 3-2
Copyright  Siemens AG 2008 All rights reserved

As soon as one or several signal tags have assumed the value '1', the tog-
gle tag is inverted cyclically.

Expanding the C-action in the picture "@AlarmOneLine.PDL"


Duplicate the command lines of the C-action at the I/O field according to
the different sound outputs:

Figure 3-3

In this example the sound file "Horn_Danger.wav" is allocated to the signal


tag "Sound_tag1", the sound file "Horn_Attention.wav" is allocated to the
tag "Sound_tag2" and the sound file "Horn_Note.wav" is allocated to the
tag "Sound_tag3".

Version V1.0 21.04.2008 26/27


Expansion options

Audible Alarms for PCS 7 Web Clients 29088810

3.2 Sound acknowledgement

The standard function "Acknowledge horn" is not available on the Web cli-
ent. But if the cyclic sound replay has been configured as described in
chapter 2.2 it can be desirable to switch off the signal without acknowl-
edgement of the message itself or without switching the entire Web client
PC silent.
To obtain an applicative solution for this functionality the Web client must
be provided with the possibility to reset the signal tag(s).
Analogously to the chapter 2.1.5 an I/O field or a button with such a func-
tion can be installed into a permanently visible system picture (preferably in
the button bar).
Copyright  Siemens AG 2008 All rights reserved

Version V1.0 21.04.2008 27/27

You might also like