39
http://support.automation.siemens.com/WW/view/en/58983189 Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

Application Example 02/2015 Email Notification with WinCC ... · PDF file Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

Embed Size (px)

Citation preview

Page 1: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

http://support.automation.siemens.com/WW/view/en/58983189

Application Example 02/2015

Email Notification with WinCC Runtime Professional WinCC Professional V13

Page 2: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

Warranty and Liability

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 2

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Warranty and Liability

Note The Application Examples are not binding and do not claim to be complete with regard to configuration, equipment or any contingencies. The Application Examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for the correct operation of the described products. These Application Examples do not relieve you of the responsibility of safely and professionally using, installing, operating and servicing equipment. 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 and without prior notice. If there are any deviations between the recommendations provided in this Application Example 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 will be excluded. Such an exclusion will 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 compensation for damages due to a breach of a fundamental contractual obligation is, 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 AG.

Security informa-

tion

Siemens provides products and solutions with industrial security functions that support the secure operation of plants, solutions, machines, equipment and/or networks. They are important components in a holistic industrial security concept. With this in mind, Siemens’ products and solutions undergo continuous development. Siemens recommends strongly that you regularly check for product updates.

For the secure operation of Siemens products and solutions, it is necessary to take suitable preventive action (e.g. cell protection concept) and integrate each component into a holistic, state-of-the-art industrial security concept. Third-party products that may be in use should also be considered. For more information about industrial security, visit http://www.siemens.com/industrialsecurity.

To stay informed about product updates as they occur, sign up for a product-specific newsletter. For more information, visit http://support.automation.siemens.com.

Page 3: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

Table of Contents

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 3

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Table of Contents Warranty and Liability ................................................................................................. 2

1 Task ..................................................................................................................... 4

1.1 Overview............................................................................................... 4 1.2 Description of the automation task ....................................................... 4

2 Solution............................................................................................................... 5

2.1 Solution overview ................................................................................. 5 2.2 Description of the core functionality ..................................................... 6 2.3 Components used ................................................................................ 8 2.3.1 Hardware and software components ................................................... 8 2.3.2 Email service ........................................................................................ 9

3 Functional Mechanisms of this Application ................................................. 10

3.1 Sending email from Runtime Professional ......................................... 10 3.2 General overview of automatic email sending ................................... 14 3.3 Detailed overview ............................................................................... 15 3.3.1 Email with individual recipient ............................................................ 15 3.3.2 Email with shift-dependent recipient .................................................. 17 3.3.3 Assigning the email address via shift management ........................... 18 3.3.4 Initialization at start of Runtime .......................................................... 19 3.3.5 Automatic email sending in the event of HMI alarms ......................... 20

4 Commissioning the Application ..................................................................... 21

4.1 Requirements ..................................................................................... 21 4.2 Commissioning the example project .................................................. 21

5 Settings ............................................................................................................. 23

5.1 Setting the SMTP server .................................................................... 23 5.1.1 Changing and saving data.................................................................. 24 5.1.2 Resetting changes .............................................................................. 25 5.2 Setting and managing the recipient addresses .................................. 26 5.2.1 Loading addresses ............................................................................. 27 5.2.2 Creating new address ........................................................................ 28 5.2.3 Deleting address ................................................................................ 29 5.2.4 Setting shift email address ................................................................. 31 5.2.5 Setting shift times ............................................................................... 32 5.2.6 Saving and resetting changes ............................................................ 33

6 Operating the Application ............................................................................... 35

6.1 Overview............................................................................................. 35 6.2 Description of the operation ............................................................... 35 6.2.1 Scenario 1: Sending emails manually ................................................ 35 6.2.2 Scenario 2: Sending email in the event of discrete alarms ................ 37 6.2.3 Scenario 3: Sending email in the event of analog alarms .................. 38

7 References ....................................................................................................... 39

8 History............................................................................................................... 39

Page 4: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

1 Task 1.1 Overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 4

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

1 Task 1.1 Overview

Introduction Since not all machines of a plant can be continuously monitored by the staff, pending messages from the SCADA system can often not be responded to quickly. This is where an email notification is to alleviate this problem.

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

?

1.2 Description of the automation task If a message appears, an email is to be sent to the respectively responsible member of staff. Setting the email user account and maintaining the email recipient is to be possible while Runtime is running. The stored data is to be saved non-volatile and loaded when Runtime is started. The email recipient is to be set shift by shift. Additionally, it is to be possible to change the times of the shift when Runtime is running. For the secure data transmission, the sending of emails is to be encrypted with SSL (Secure Sockets Layer).

Page 5: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

2 Solution 2.1 Solution overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 5

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

2 Solution 2.1 Solution overview

Schematic layout The figure below shows a schematic overview of the most important components of the solution: Figure 2-1

Email client

Mobile email client

ervice

Advantages This application offers the following advantages: • You are using a standardized means of communication via email notification.

Messages can therefore be sent to all email clients, e.g. also to smartphones. • You increase safety, since it can be quickly reacted to the event. Even also if

the machine operator is absent. • An email notification sends information directly to the executing department

such as sales or workshop. The required activities can be implemented instantly since the necessary information is instantly available and does not need to be read on the SCADA system first.

• You can change the email addresses directly on the SCADA system and save it reliably via the non-volatile management. This makes you flexible and protects you from data loss.

• With our extensive templates you reduce the configuration phase for email notifications to a minimum.

Page 6: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

2 Solution 2.2 Description of the core functionality

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 6

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Delimitation This application does not contain any descriptions on the following issues: • Installation of SIMATIC WinCC Professional. • Installation of SIMATIC WinCC Runtime Professional. • Configuration and commissioning of SIMATIC WinCC Runtime Professional.

Assumed knowledge Basic knowledge of the SIMATIC WinCC Professional software product is assumed. Basic knowledge of the configuration of an email service.

2.2 Description of the core functionality

Overview and description of the user interface The figure below shows the configuration of the SMTP data and the setting and management of the recipient email addresses. Figure 2-2

Page 7: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

2 Solution 2.2 Description of the core functionality

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 7

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

What does the application example perform? In this application the following components are included: • VB scripts for the sending of emails in WinCC Runtime Professional. • Task planer for the initialization of the data (SMTP configuration, shifts). • Task planer for the shift change. • User interface for the configuration of the SMTP data. • A user interface for managing recipient addresses and assigning shift-specific

addresses and the setting of shift times.

Sequence of the core functionality Figure 2-3

Email addresses

ManualAppearance of anHMI alarm

Email

Early shift

Late shift

Night shift

Setting theactive shift

Activeemail address

Configuredemail address

The application example shows the following application options: • Manual sending of an email via an interface.

Specify the email recipient address during the configuration. • Automatic sending of an email in the event of alarms

(discrete alarms, analog alarms). The email recipient address is automatically assigned, depending on the active shift.

Page 8: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

2 Solution 2.3 Components used

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 8

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Overview and description of the user interface In this example, the following operator screens were configured: • SMTP Configuration:

This screen is used for the configuration of the SMTP server and for setting and managing the email recipient addresses.

• Examples for sending emails: In this screen, the different application options for sending emails are explained.

2.3 Components used

2.3.1 Hardware and software components

The application was created with the following components:

Standard software components Table 2-1

Component No. Article number Note

SIMATIC WinCC Professional V13 SP1

1 6AV2103-0DA03-0AA5

SIMATIC WinCC Runtime Professional V13 SP1

1 6AV2105-0BA03-0AA0

Windows operating system

Incl. CDO Messaging Libraries

Example files and projects The following list includes all files and projects that are used in this example. Table 2-2

Component Note

58983189_Emails_WinCC_Professional_RT.zip This zip file contains the WinCC Professional project.

58983189_Emails_WinCC_Professional_RT_en.pdf This document.

Page 9: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

2 Solution 2.3 Components used

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 9

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

2.3.2 Email service

Required email service In order to use this application example, you require an email service. You need information on the following data of your email service: • Email address • SMTP Server (outgoing mail server) • Port of the SMTP server • User name and password of the SMTP server suitable to the email address • Support of the SSL encryption

Note Functions from the WinCC Runtime Professional operating system are used for the sending of emails. (See Related Literature \3\.) This means, that the actual sending of emails is by the operating system, triggered by WinCC.

When selecting your email service, pay attention to the compatibility of the email functions of your operating system. If in doubt, ask your email provider for compatibility.

Page 10: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.1 Sending email from Runtime Professional

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 10

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3 Functional Mechanisms of this Application 3.1 Sending email from Runtime Professional

Sending emails The sending of emails is triggered by a script from WinCC Runtime Professional. The actual sending is through the operating system functions of the CDO libraries. (See Related Literature \3\.)

Note Functions from the WinCC Runtime Professional operating system are used for the sending of emails. (See Related Literature \3\.) This means, that the actual sending of emails is by the operating system, triggered by WinCC.

When selecting your email service, pay attention to the compatibility of the email functions of your operating system. If in doubt, ask your email provider for compatibility.

Page 11: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.1 Sending email from Runtime Professional

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 11

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Sequence of sending emails The following figure shows you the sequence of sending emails from the WinCC Runtime Professional script. Figure 3-1

Start triggerscript

Initializingdiagnostics

Creating objectCDO.Message

Creating objectCDO.Config…

ConfiguringSMTP Server

Writingdiagnostics file

Releasingobjects

End of script

Defining the SMTP server data• Server address• Authentication type• Login name• Login password• Server port• Enabling SSL encryption• Communication timeout

Diagnostic The replies of the email server are saved in a file. This functionality is to provide an overview of sent emails and simplifies diagnostics in the event of an error. This file is stored under the name “Report.txt” in the temp folder of the operating system.

Page 12: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.1 Sending email from Runtime Professional

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 12

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Note In order to display the diagnostics, proceed as follows:

1. Open the Windows Explorer. 2. Enter “%temp%” in the address line.

3. Confirm with “Enter”. 4. Now select the “Report.txt” file.

Error detection For the error detection the following procedure can be recommended. • Using a local email server.

(e.g. Office Mail 2.0, see \4\) • Testing the local email server with a local email client.

(e.g. Outlook Express or Mozilla Thunderbird)

Page 13: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.1 Sending email from Runtime Professional

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 13

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

• After the successful test with the local email client, use of the application example with the local email server. (SMTP server: “localhost”)

• Use of the “remote” email service/server with local email client. • After the successful test of the “removed” email service/server with the local

email client, use of the application example with “remote” email service/server.

Note Release of the used port in the firewall Check whether your firewall allows the sending via the respective port with the above procedure. Check your local firewall and, if required, further firewalls in your infrastructure.

Different port for SSL encryption Check the port used by the email service. If necessary, adjust it in the script.

Page 14: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.2 General overview of automatic email sending

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 14

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3.2 General overview of automatic email sending Figure 3-2

Configuration Configuration

SMTP datais loaded

Start Runtime

Shift data is loaded

Runtime

Email trigger

Using shiftaddress?

Email is sentto set email

address

No

YesActive email

address

Email addresses

Early shift

Late shift

Night shift

Setting the active shift

Email is sent toactive email

address

Status is saved in alog file

Changes are writtenin the file

Save changes

Yes

SMTP

Changes are writtenin the file

Save changes

Yes

Windows file system

WinCCtag storage

Explanation

After the Runtime start, the configuration and shift data is loaded and written into the WinCC tag management (if data already exists). This data can be changed after the Runtime start and subsequently saved in the files. (See chapter: 5.1 Setting the SMTP server and 5.2 Setting and managing the recipient addresses.) If an email is to be sent, the following is distinguished: • Email with individual recipient

The email address of the recipient is directly specified on the function when configuring.

• Email with shift-dependent recipient The email address of the recipient is not directly specified on the function. The function uses the active email address that is assigned via shift management. When calling this function an email with the entered subject and text is sent to the assigned email address.

The following is necessary: • Internet/intranet connection • Configured SMTP server • Entered mandatory parameters “address”, “subject” and “text”

Page 15: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.3 Detailed overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 15

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3.3 Detailed overview

3.3.1 Email with individual recipient

Figure 3-3

Configuration

Email trigger

Usingshift address?

Email is sentto set email

address

No

Status is saved in alog file

SMTP

Page 16: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.3 Detailed overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 16

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Explanation For the sending of emails with individual recipient the “SendEmailVB” function is provided. This function sends an email to the email address transmitted in the call. The function call looks as follows: Figure 3-4

Table 3-1

Attribute Description

From In this field the name of the sender is entered. Recipient In this field the email address of the recipient is entered. BCC In this field the email address is entered to which a copy is to be sent. This

email address is not included in the header of the email. CC In this field the email address is entered to which a copy is to be sent. Subject In this field the subject of the email is specified. Message In this field the message of the email is specified.

Note This function is executed irrespective of the shift management.

Page 17: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.3 Detailed overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 17

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3.3.2 Email with shift-dependent recipient

Figure 3-5

Configuration Configuration

Active email address

Email addresses

Early shift

Late shift

Night shift

Setting the active shift

Email is sent toactive email

address

Status is saved in alog file

SMTP

Explanation The “SendEmailShift” function is provided for the sending of emails with shift-dependent recipients. This function sends an email to the email address of the active shift. This is why no email address has to be transmitted. This email address is automatically assigned the “Shift_Change” task. The function call looks as follows: Figure 3-6

Table 3-2

Parameter Note

Subject Here the subject of the email is specified. Message Here the message of the email is entered.

Page 18: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.3 Detailed overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 18

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3.3.3 Assigning the email address via shift management

Configuration

Active email address

Email addresses

Early shift

Late shift

Night shift

Setting the active shift

Explanation The automatic assignment of the active email address was realized via the “Shift_Change” task in the task planner. Structure of the task: • Cyclic reading of the current system time. • Comparison of the readout system time with the set shift times. • The email address with the respective shift is assigned as active email

address. The shift times and addresses are set via the “Recipient List” faceplate (see chapter: 5.2 Setting and managing the recipient addresses).

Page 19: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.3 Detailed overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 19

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3.3.4 Initialization at start of Runtime

Figure 3-7

Configuration Configuration

SMTP datais loaded

Start Runtime

Shift data is loaded

Runtime

Email addresses

Early shift

Late shift

Night shift

Setting the active shift

SMTP

WinCCtag storage

Active email address

Explanation When starting Runtime the configuration and shift dates are loaded in the WinCC tag management. This is performed via the “Initialization” task in the task planner. At the start of Runtime, the “Start_initialisation” tag is set in the start screen which triggers the task.

Structure of the task: • Reads SMTP data from the “SMTP_config.txt” file and writes it into the WinCC

tag management. • Reads shift settings from the “Email_shifts.txt” file and writes it into the WinCC

tag management.

The following data is loaded: • SMTP server name • Name of the sender (can be selected as desired) • Email address of the sender • Login name • Password (if saved) • Set shift addresses • Set shift times Requirements: • Files have been created • File path has been specified or adjusted (tag: “Storage_path”)

Page 20: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

3 Functional Mechanisms of this Application 3.3 Detailed overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 20

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

3.3.5 Automatic email sending in the event of HMI alarms

In order to send an email automatically in the event of an HMI alarm, a trigger tag is inverted with the “Incoming” event of the respective alarm. Figure 3-8

If there is a change of this tag, the “SendEmailShift” script is called via the “Email_Alarm” job. Figure 3-9

Page 21: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

4 Commissioning the Application 4.1 Requirements

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 21

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

4 Commissioning the Application 4.1 Requirements

Install SIMATIC WinCC Professional V13.0 SP1 and SIMATIC WinCC Runtime Professional V13.0 SP1. Make sure that there is a connection to the internet/intranet.

4.2 Commissioning the example project Table 4-1

No. Action Remarks

1 Unzip the “58983189_Emails_WinCC_ Professional_RT.zip” file.

2 Start the example project by double

clicking the “58983189_Emails_WinCC_ Professional_RT.ap13” file.

3 Open the “Runtime settings” of

Runtime Professional.

4 Select “Services”.

Page 22: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

4 Commissioning the Application 4.2 Commissioning the example project

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 22

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

No. Action Remarks

5 Enable the “Scheduled tasks in runtime” service if not already done.

9 Open the “HMI tags Email

Setting tags” folder of WinCC Runtime Professional.

10 Select the “storage path” tag and

adjust the storage path in “Properties Values Start value” as desired. The SMTP and shift data is saved in this path.

Page 23: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.1 Setting the SMTP server

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 23

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5 Settings For the sending of emails various settings have to be made. Special faceplates have been created for this purpose with which you can conveniently make these settings. These settings can furthermore be adjusted while Runtime is running.

5.1 Setting the SMTP server

The “SMTP server” (Simple Mail Transfer Protocol) or also email server is a server with which emails can be sent. For the receipt of an email, “POP3 Server” or “IMAP Server” are used. For the setting of the data, the following faceplate with the name “SMTP Settings” was created: Figure 5-1

Table 5-1

Attribute Note

Server name In this field, the address of the email server is entered.

Sender name In this field the displayed sender name is entered. This name can be selected freely, e.g. “Hall1”, etc.

Email address In this field the email address of the sender is entered.

Log in In this field the login name is entered (it often corresponds with the email address).

Password In this field the password for the authentication is entered.

Reload By clicking this button all changes are reset to the last memory state.

Save password With this checkbox, it is specified whether the password is saved.

Page 24: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.1 Setting the SMTP server

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 24

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

NOTICE All configuration data (incl. possibly the password) is saved unencrypted.

Make sure that only authorized persons have access to the file, if you save the password.

5.1.1 Changing and saving data

This is how you change the saved SMTP configuration. Table 5-2

Action Remarks

Make the desired changed while runtime is running.

Click the “Save” button to permanently save the changes. By clicking this button all changes are saved. Notice: The previous data is irrevocably lost. You can specify whether the password is to be saved via the "Save password" checkbox.

Page 25: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.1 Setting the SMTP server

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 25

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5.1.2 Resetting changes

This is how you reload the saved SMTP configuration.

Note This is only possible as long as it has not been saved.

Table 5-3

Action Remarks

Press the “Reload” button.

Page 26: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 26

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5.2 Setting and managing the recipient addresses There are two options for setting the email address of the recipient. The function of an individual address can be either specified directly or a shift-dependent email address can be used. • Individual address This address is directly specified when calling the function and can be selected as desired. This address cannot be changed during runtime. • Shift-dependent address For this purpose the “Recipient list” faceplate was created especially. This block makes it possible to conveniently and easily set and manage your recipient email addresses. Interface of the faceplate: Figure 5-2

Table 5-4

Attribute Note

Recipient list The desired email address can be selected in this field after loading it.

load By clicking this button all saved emails are loaded and displayed in the recipient list.

Add By clicking this button, an input window opens in which the new email address can be entered.

Delete By clicking this button, the selected email address can be deleted from the database.

Early, late and night shift

The currently set email addresses are displayed in these fields.

Select By clicking this button, the email address selected in the recipient list is accepted as the current shift address.

Page 27: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 27

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Attribute Note

Times In these fields the currently set shift times can be seen. They can be adjusted by clicking the desired field.

Resetting By clicking this button all changes on the shift settings are reset to the last memory state.

Save By clicking this button all changes are saved in a file. Notice: The previous data is irrevocably deleted.

Note After a change of screen, a change of language or a change in the recipient addresses (add, delete), the recipient list has to be reloaded.

5.2.1 Loading addresses

Table 5-5

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Acknowledge with the “Load” button.

Page 28: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 28

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5.2.2 Creating new address

Table 5-6

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Click the “Add” button.

Enter the new email address.

Page 29: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 29

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Action Remarks

Save the new address by clicking the “OK” button.

5.2.3 Deleting address

Table 5-7

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Page 30: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 30

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Action Remarks

Load the email addresses and select the email address you want to delete.

Click the “Delete” button.

Confirm the deleting of the address with the “Yes” button.

Page 31: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 31

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5.2.4 Setting shift email address

Table 5-8

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Load the email addresses and select the new email address you want to delete.

Click the “Select” button of the shift to be changed.

Page 32: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 32

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5.2.5 Setting shift times

Table 5-9

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Select the times to be changed and enter the new time.

Page 33: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 33

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

5.2.6 Saving and resetting changes

Save Table 5-10

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Click the “Save” button.

Page 34: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

5 Settings 5.2 Setting and managing the recipient addresses

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 34

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

Resetting Table 5-11

Action Remarks

Start Runtime.

Click the “Example” button.

Click the “SMTP Configuration” button.

Click the "Reset” button.

Page 35: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

6 Operating the Application 6.1 Overview

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 35

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

6 Operating the Application 6.1 Overview

The sample project includes two operating screens. • Configuration of the SMTP data and setting the shift addresses/times (see

chapter 5 Settings). • Example for triggering emails.

6.2 Description of the operation

6.2.1 Scenario 1: Sending emails manually

Description In the sample project buttons have been configured that send emails in the “click” event. The email is sent via the “SendEmailVB” function.

Instruction Table 6-1

No. Action Remarks

1 Go to the screen “001_Thema > 001_2_Email_Trigger_Example”.

2 Select the “Manual VB Script” button and

replace the “Recipient” parameter of the “SendEmailVB” function by your recipient address in “Properties > Events > Click”.

3 Start Runtime.

Page 36: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

6 Operating the Application 6.2 Description of the operation

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 36

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

No. Action Remarks

4 Click the “Example” button.

5 Click the “Example for sending emails” button.

6 Click the “Manual VB Script” button to send an

email to the configured email address. Requirement: SMTP configuration was performed as described in chapter 5.1 Setting the SMTP server.

7 If all settings have been carried out properly,

an email has now been sent.

Page 37: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

6 Operating the Application 6.2 Description of the operation

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 37

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

6.2.2 Scenario 2: Sending email in the event of discrete alarms

Description In the example project, a button was configured that inverts a tag in the “click” event. If a tag has a rising edge, a discrete alarm is triggered. As soon as this alarm is triggered, the trigger tag is inverted via which the configured email is sent to the active email address via the “SendEmailShift” function in the “Email_Alarm” task.

Instruction Table 6-2

No. Action Remarks

1 Start Runtime.

2 Click the “Example” button.

3 Click the “Example for sending

emails” button.

4 Click the “Discrete alarm” button

to send an email to the active email address. Requirement: SMTP configuration was performed as described in chapter 5.1 Setting the SMTP server.

5 If all settings have been carried

out properly, an email has now been sent.

Page 38: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

6 Operating the Application 6.2 Description of the operation

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 38

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

6.2.3 Scenario 3: Sending email in the event of analog alarms

Description A slide control was configured in the example project via which the value of an integer tag can be changed. If the tag exceeds the set limit value, an analog alarm is triggered. As soon as this alarm is triggered, the trigger tag is inverted via which the configured email is sent to the active email address via the “SendEmailShift” function in the “Email_Alarm” task. Instruction Table 6-3

No. Action Remarks

1 Start Runtime.

2 Click the “Example” button.

3 Click the “Example for sending emails” button.

4 Select the “Analog alarm” slide control and

change the value of the tag. If the limit value (50) is exceeded, an analog alarm is triggered that sends an email to the active email address.

5 If all settings have been carried out properly,

an email has now been sent.

Page 39: Application Example 02/2015 Email Notification with WinCC ... · PDF file  Application Example 02/2015 Email Notification with WinCC Runtime Professional WinCC Professional V13

7 References

E-Mail WinCC RT Professional Entry ID: 58983189, V1.1, 02/2015 39

S

iem

ens

AG 2

015

All r

ight

s re

serv

ed

7 References Table 7-1

Topic Title

\1\ Siemens Industry Online Support

http://support.automation.siemens.com

\2\ Download page of the entry

http://support.automation.siemens.com/WW/view/en/58983189

\3\ CDO Libraries Wikipedia (EN)

http://en.wikipedia.org/wiki/Collaboration_Data_Objects

\4\ Office Mail 2.0 http://www.burrotech.com/om_download.php

\5\ WinCC Professional V13.0 SP1 Manual

http://support.automation.siemens.com/WW/view/en/109096785

8 History Table 8-1

Version Date Modifications

V1.0 04/2012 First version V1.1 02/2015 Update (WinCC V13 SP1, SSL)