Cover

Individual Signaling System Based on OPC Alarm and Events with the SIMATIC NET OPC Alarm and Event Server (COM/DCOM)
SIMATIC NET OPC Server (CD Edition V 8.0) Application Description  April 2011

Applications & Tools
Answers for industry.

Siemens Industry Online Support This article is taken from the Siemens Industry Online Support. The following link takes you directly to the download page of this document: http://support.automation.siemens.com/WW/view/en/26548467 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

If you have any questions concerning this document please e-mail us to the following address: mailto:online-support.industry@siemens.com
Copyright  Siemens AG 2011 All rights reserved

You can also actively use our Technical Forum from the Service & Support Portal regarding this subject. Add your questions, suggestions and problems and discuss them together in our strong forum community: http://www.siemens.com/forum-applications

2

Alarm Client with OPC A&E V2.0, ID Number: 26548467

s

Automation Problem

1 2 3 4 5 6 7 8 9 10

Automation Solution General Functional Mechanisms Functionality of the Client Application Explanation of the S7 Sample Program

SIMATIC Alarm Client with OPC A&E
for SIMATIC NET CD Edition 2010

Installation and Startup

Configuration
Copyright  Siemens AG 2011 All rights reserved

Operation of the Application

Related literature

History

Alarm Client with OPC A&E V2.0, ID Number: 26548467

3

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 correctly used. 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 Siemens 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 – then 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 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”). 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. It is not permissible to transfer or copy these application examples or excerpts of them without first having prior authorization from Siemens Industry Sector in writing.

Copyright  Siemens AG 2011 All rights reserved

4

Alarm Client with OPC A&E V2.0, ID Number: 26548467

........................... 72 Configuration of the PC station .............................................. 16 OPC A&E basics and delimitation from OPC DA................ 27 Class diagrams of the alarm client ...............2 5....................................... 59 Sample configuration of system error messages................0 ....3.................. 14 3 General Functional Mechanisms .....2 2.................. 15 OPC Alarm & Events basics .3.........................................................................4 Hardware and software installation .....3 4.....8 Extended alarm configuration for STEP 7 V5.......... 50 User program of this example ...........................................3 Configuration of the SIMATIC S7 stations ..........................3.................................................................... 46 Display of attributes in OPCEventNotification............................................... 43 5.......................... 36 5 Explanation of the S7 Sample Program ........1 7............1 4.......... 15 3..........................................................................................................4 5........................ 79 8 9 Operation of the Application .. 56 Sample call of an ALARM_8P.................1 1...................................................0............... 67 Configuration of the SIMATIC S7 stations ... 7 Solution...................................................... 8 Description of the core functionality ................... 66 6.............. 17 Functional mechanisms of OPC Alarm & Events.......... 6 1............................................................................................................................................ 30 OPC A&E client sample application .................2 7.............................................4 Functionality of the alarm client.........1 3................................................................................. 65 6 Installation and Startup.........2 3.............................................2 3................................6 5.................1 2......................... 8 2..... 53 Sample configuration of a SCAN alarm ................................................................ 21 Methods of the EventServer object ............................................................................................... 66 Application software installation .............. ID Number: 26548467 5 .............................................................. 43 Alarms of the SIMATIC S7 station ..2 4...5 and higher ............. 21 Methods of the EventSubscription object....3 2......................................................................................................................................2 4....... 16 OPC Alarm and Events model ........................................................................................................................ 62 Information on the alarm configuration of the S7-300.............7 5...............................................3 OPC basics ................................. 72 7................ 86 9......2 Bibliography................. 6 Requirements ....................................3 6................................................ 70 7 Configuration .. 29 OPC Alarm and Event Client API.....2........3.......... 81 Related literature .....................................................................................................3.. 23 Copyright  Siemens AG 2011 All rights reserved 4 Functionality of the Client Application.................................................1 3.........................1 6.....3 5..5 5..........................1 3............................. 86 Internet link specifications ..........2... 26 Functional mechanisms of the alarm client .......................2 2 Overview ...........................................1 9..............................................................3 3........................Table of Contents Table of Contents Warranty and Liability .................2 6................ 26 4.............1 4................................ 22 Receiving messages from the A&E server........... 75 Configuration of the OPC A&E server < V8.... 4 1 Task........ 34 Sequence diagrams of the alarm client..................... 67 Commissioning of the PC station ...................................................2 3....................................................... 13 Performance data............................ 9 Required hardware and software components ...............................4 Overview of the overall solution ............................................... 86 Alarm Client with OPC A&E V2.....1 5..........................................................

6 Alarm Client with OPC A&E V2. ID Number: 26548467 . different devices are used to control the process. The automation problem consists of acquiring event messages and alarms from the automation systems in a central signaling system on a PC station.0. standardized mechanisms are preferably used today to ensure that such a data exchange remains independent of the used bus system or protocol or even manufacturer. Furthermore. The PC station collects the alarms and displays them in the correct order. Figure 1-1 shows the components involved.1 Overview 1 1. A communications link to the PC stations via Profibus is basically also possible. In this case. Introduction Overview of the automation problem The figure below provides an overview of the automation problem. the PC station can acknowledge alarms if this is necessary. however. Figure 1-1 PC application Copyright  Siemens AG 2011 All rights reserved Display Acknowledgement Signaling system Description of the automation problem In an automation system.1 Task Overview In order to realize a data link. Automation systems and PC station are to communicate via Ethernet. it will not be discussed here to simplify matters. these devices are two SIMATIC S7 controllers.1 Task 1. A standardized mechanism for connecting different subsystems is also to be used for the exchange of event and alarm messages.

0. The controller must have a communication option to a central signaling system. Automation problem requirements Controller requirement The controller should be capable of actively sending a message from the user program in the event of unexpected events without requiring the PC station to poll the controller.1 Task 1. Copyright  Siemens AG 2011 All rights reserved The application for the display and acknowledgement of event messages is to use a standardized interface to the communications software to be able to integrate any event sources. Alarm Client with OPC A&E V2. preferably via Ethernet. it is used to signal important events from the controller without generating unnecessary communication load on the controller by polling the PC station. ID Number: 26548467 7 .2 Requirements The alarm and event mechanism is not used for cyclic transmission of large data volumes. PC station requirements The PC station must have the necessary physical connection to the respective hardware and software for the communication with the controller. rather.2 Requirements 1.

2 Solution 2. Scope This application does not include a description of the following: • • • Basics of configuring and programming SIMATIC stations with STEP 7. ID Number: 26548467 .5 • Visual Studio 2005 (C#) • AE Alarm-Client Copyright  Siemens AG 2011 All rights reserved SIMATIC S7-300 Station • CPU 315-2 DP • CP 343-1 SIMATIC S7-400 Station • CPU 416-3 DP • CP 443-1 Advanced Configuration Via Ethernet. A standard Ethernet card (alternatively a CP 1613 or 1612) is used in the PC.1 Overview of the overall solution 2 2. COM/DCOM basic technology and its configuration. 8 Alarm Client with OPC A&E V2.NET and language syntax of C#. Principle of operation of .1 Solution Overview of the overall solution The diagrammatic representation below shows the most important components of the solution: Figure 2-1 Diagrammatic representation SIMATIC PC Station • Windows 7 • Standard Ethernet Card • SIMATIC NET CD 2010 (V8.0) • SOFTNET S7 IE/Lean • STEP 7 V 5. a PC station is connected to a CPU 315-2 DP and a CPU 416-3 DP using the relevant Ethernet CPs.0. Basic knowledge of these topics is required.

• • • If an event occurs.g. Selecting and displaying attributes.2 Description of the core functionality The SIMATIC NET OPC Alarm and Event (A&E) server forms the core of the functionality of this example. for example ALARM_8P. depending on the alarm type. the S7 station sends an event to the SIMATIC NET OPC server. an E0. Filtering alarms by severity and type as well as source and area. Via the S7 protocol. an alarm block.0. unlike an OPC Data Access server. Highlighting messages requiring acknowledgement. The figure below shows the functional chain for such a message. is capable of receiving messages directly from the controller without having access the controller on a polling basis. which. Acknowledging indicating the user.2 Description of the core functionality 2. For this purpose. can be called in the S7 program. Acknowledgement: Alarm Client with OPC A&E V2. Displaying message texts and associated values. The OPC A&E server converts all information to OPC parameters and sends an alarm to the OPC client application.2 Solution 2. e. the application provides the following functionality: Display: • • • • • • • Registering for the reception of events. Browsing sources and areas. Figure 2-2 Display Copyright  Siemens AG 2011 All rights reserved S7 protocol S7 connection The OPC client application shown here offers the option to display OPC alarms and. ID Number: 26548467 9 . to acknowledge these alarms.3 error input is set.

for example event message or alarm.2 Solution 2. ID Number: 26548467 . The message type. The alarms and event messages are inserted into the list from the top in the order of their occurrence.2 Description of the core functionality Overview and description of the user interface The window of the user interface in Figure 2-3 displays the list of alarms and event messages. Alarms are acknowledged using a context menu on the alarm message or via the Server menu. The Server and Subscription menus are used for the connection establishment to the server and the communication configuration.0. The user can select additional associated values for the display and make filter settings for the signaled events and alarms. Figure 2-3 Copyright  Siemens AG 2011 All rights reserved 10 Alarm Client with OPC A&E V2. is indicated by the color of the message. The status of an alarm with regard to acknowledgement and activity is indicated by the shading of the color and icons in the message line.

Table 2-1 Action 1. 6. 3. 7. category and event type Different behavior of active and inactive alarms 5. 2. Figure 2-4 PC application A & E client Configuration Acknowledgement Display of events S7 protocol Copyright  Siemens AG 2011 All rights reserved The following table describes which steps have to be performed to trigger different alarms and to operate the sample application. ID Number: 26548467 11 . Trigger diagnostic alarms of the controllers Change the filter criteria Acknowledge selected alarms Alarm Client with OPC A&E V2. Select the OPC A&E server Register for the reception of events Trigger alarms on the process Trigger alarms of the connection Note The server must be an A&E server Buffer time and filters are indicated for the subscription Initiation of programmed alarms with associated values in the PLC Simulation of an interruption of the connection by removing the Ethernet cable or switching off the CP Simulation by start/stop or warm restart of the controller Severity.2 Description of the core functionality Sequence of the core functionality Figure 2-4 schematically shows the most important components of this solution.0.2 Solution 2. 4.

Configurable.2 Description of the core functionality Advantages of this solution The advantages of the solution presented here include the use of the manufacturer-independent and widely used OPC technology. Advantages of the solution in detail: • • • • • • • Use of the international OPC Alarm and Events standard.0. Connection of non-Siemens systems with identical mechanism. Acknowledgement of alarms via the OPC Alarm and Events standard. thus flexible solution.2 Solution 2. Investment protection by expansion capability. This sample implementation shows the most important possibilities of the OPC Alarm and Events interface. Copyright  Siemens AG 2011 All rights reserved 12 Alarm Client with OPC A&E V2. ID Number: 26548467 . Easy realization of a connection to different event and alarm sources. High-performance data transmission by using the event mechanisms at all communication levels without the necessity for polling access.

Alarm Client with OPC A&E V2. PG) with Windows 7 (32-bit). 8xIO.NET Framework 1 2. hardware configuration for the PC station and the SIMATIC stations). 1 MLFB/order number 6AG4 001-0AA21-0KX0 Note Configurator: See FAQ ID 17128155. Table 2-4 Component 26548467_OPC_AE _DOKU_v20_e. LW=8 S7 connections (Lean). Download from the Microsoft home page \8\ To order this component. digital. (Optional) When using an older SIMATIC NET version.5 SIMATIC NET CD 2010 (V8.0) SOFTNET S7 IE Qty. This zip file contains the executable files for the OPC client and the Visual C# project with the source code. ID Number: 26548467 13 .g. CW=64 S7 connections.NET 2005 Professional 1 page \8\ Sample files and projects The following list contains all files and projects that are used in this example. digital. visit the Microsoft home Microsoft . the onboard Ethernet card can also be used. (Optional) Only if changes to the contact your administrator or sample code are necessary. Optionally. Simulation module.3 Table 2-2 Required hardware and software components Hardware components Component Industrial PC SIMATIC Rack PC IL 40 S CP 1613 communications processor for ETHERNET. 32xIO..pdf OPC_AE_STEP7_v20. Simulation module.zip This document. This zip file contains the STEP 7 project (incl.3 Required hardware and software components 2. Alternatively: Standard PC (e. 1 6GK1 161-3AA00 1 1 1 1 1 1 6ES7416-3XR05-0AB0 6GK7443-1GX20-0XE0 DI/DO simulator 6ES7 315-2AG10-0AB0 6GK7343-1EX30-0XE0 DI/DO simulator Standard software components Table 2-3 Component STEP 7 V5. PCI card CPU 416-3 DP CP 443-1 Advanced SM474 CPU315-2 DP CP 343-1 SM374 Copyright  Siemens AG 2011 All rights reserved Qty.zip Note OPC_AE _CODE_v20.0 Microsoft Visual Studio . S7 CPU. Ethernet onboard. 1 1 MLFB/order number 6ES7 810-4CC08-0YA7 6GK1704-1LW71-3AA0 6GK1704-1CW71-3AA0 Note To configure and program S7 300 / 400 CPUs. Ethernet communications processor.2 Solution 2. Ethernet communications processor. S7 CPU.0.

the Ethernet interface of an S7-300 with a CP343-1 and a CP443-1 in an S7-400 controller are used. 50 (even less. The OPC A&E server complies with the current OPC specification and the OPC Foundation’s latest OPC Compliance Test Tool was used to test its conformity with the OPC specification. Copyright  Siemens AG 2011 All rights reserved Hardware The SIMATIC S7 300 or 400 station and the PC must feature communications processors that support the S7 protocol. The suitable Profibus interfaces have to be used in the S7 300/400. For more information. please refer to the Step7 online help of the relevant system functions and the S7 CPU manual. These resources will be released as soon as the alarm cycle is completed. Only a limited number of resources is available. Note The SIMATIC NET product includes an additional OPC Alarm & Event server that can receive alarms of SNMP devices. system resources will be occupied for the duration of one signal cycle. The current status of the dynamically occupied system resources can be checked using the SFC 105 block. On the PC side. this example uses S7 connections (RFC1006) via a standard Ethernet card (alternatively. The S7 protocol is the only protocol that is capable of actively sending alarms from the programmable controller. S7 user program When calling the SFC blocks in the S7 CPU. S7 connections are then configured via a respective Profibus card (CP5613/14 or CP5611). 14 Alarm Client with OPC A&E V2. The OPC A&E server is installed by default during setup and does not have to be selected or configured separately.2 Solution 2. depending on the CPU type). a CP1613 or CP1612 would also be possible). Number and scope of possible alarm blocks depend on the S7 CPU type.0. The example can also be operated on Profibus hardware in the same way. the OPC A&E functionality is only provided via the S7 protocol. Alarm blocks are system functions (SFC) and thus an integral part of the S7 CPU operating system. This document refers only to the A&E server of the S7 protocol. On the S7 side. It is irrelevant whether the S7 protocol is operated via Profibus or Ethernet.4 Performance data 2.4 Performance data The Alarm & Event functionality is integrated in the SIMATIC NET product. thus while an alarm is present. ID Number: 26548467 . Therefore. which ensures that the maximum number of simultaneously active alarms is approx.

Note If the client is located on a computer other than the server and accesses the data “remotely”.opcfoundation. A detailed documentation is available on the SIMATIC NET CD-Rom. this is referred to as a DCOM connection. Copyright  Siemens AG 2011 All rights reserved What is OPC OPC is a collection of software interfaces for data exchange between PC applications and process devices. The OPC A&E server collects events from the process. please go to www. Historical Data Access (HDA) and Data eXchange (DX). the OPC Foundation (an interest group of well-known manufacturers for the definition of standard interfaces) has defined a large number of software interfaces to standardize the information flow from process level to management level. You only require this part if you are interested in the interaction of the solution components. 3. four OPC specifications have been developed: Data Access (DA). This example deals with the OPC Alarm and Events 1. For more information.org.10 interface. COM or DCOM (distributed COM) provides the interprocess communication functionality and organizes the exchange of information between applications even across computer boundaries (DCOM). Using mechanisms of the Microsoft operating system. OPC DX also allows direct data exchange between two OPC DA servers. the solution structures and – where useful – the specific implementation of this application. including acknowledgement.3 General Functional Mechanisms 3.1 OPC basics 3 Contents General Functional Mechanisms This part describes the detailed functional sequences of the involved hardware and software components. Alarm Client with OPC A&E V2. The OPC client starts the server and can access the offered data. HDA describes functions for archived data and DX defines a lateral server to server communication.0. Access to process data is described in the DA specification. a client registers for notification and can set filters to have only very specific alarms signaled. The OPC server provides process information of a device at its interface. an OPC client (COM client) can use it to exchange information with an OPC server (COM server). These software interfaces have been defined according to the rules of Microsoft COM (Component Object Model) and can therefore be easily integrated into Microsoft operating systems. According to the different requirements in an industrial application. A&E describes an interface for event-based information.1 Overview OPC basics In recent years. ID Number: 26548467 15 . Alarm & Events (A&E).

the OPC client can specify filter criteria.1 OPC A&E basics and delimitation from OPC DA OPC Data Access The OPC Data Access interface allows reading. The OPC client logs on by establishing a connection to the A&E server. These items can then be read or written by the client. Filters for messages can be configured on the 16 Alarm Client with OPC A&E V2. the OPC A&E client logs on to the server and then receives all messages that are triggered in the server. To receive messages. 3.2. Such a status can. However.3 General Functional Mechanisms 3. This acknowledgement is also possible via the OPC Alarm & Events interface. Figure 3-1 OPC Alarm and Events The OPC Alarm & Events interface allows the reception of event messages and alarm messages. consequently creating an OPCEventServer object in the OPC server. OPC Alarm & Events thus provides a flexible interface for transmitting process alarms and events from most diverse event sources. Alarm messages are messages that inform the client on the change of a status in the process. the preferred way for the data exchange from server to client is monitoring during which the server. Copyright  Siemens AG 2011 All rights reserved This means that events with changed data are also sent to the client when using OPC Data Access if the values of the selected items have changed. ID Number: 26548467 . writing and monitoring variables.2 OPC Alarm & Events basics This chapter explains the basics of the OPC Alarm and Events (A&E) interface that are necessary for the example. for example. The OPC DA client explicitly defines the variables (OPC items) it wants to read. signals the values of items to the client that have changed since the last cycle. The OPC client makes this definition by establishing a connection to the server in the first step. a status change can occur when a maximum level is exceeded or a minimum level is fallen below. be the level of a tank. in the first step and by generating an OPCEventSubscription via which the messages are received in the second step.2 OPC Alarm & Events basics 3. However.0. the OPC client explicitly selects the items to be monitored. Figure 3-1 shows the different objects the OPC client creates in the server. write or monitor from the server. Event messages are single messages that inform the client on the occurrence of an event. In this example. Alarms mostly additionally require that the alarm be acknowledged. thus creating an OPCServer object in the OPC server. after the set update time. by creating an OPCGroup in which it can group items with identical settings such as update time in the second step and then by inserting items into the group in the third step. To limit the number of messages.

The properties are described using the example of the level of a tank. An alarm is typically a fault condition of the process that requires special handling. Such a condition can. Figure 3-2 shows the different objects the OPC client creates in the server. Single signaling of changes to the process without condition such as the change of a setpoint. be a limit value whose violation causes the activation of the condition and triggers a Condition Event. In contrast to OPC DA. Each condition change triggers an event message. Copyright  Siemens AG 2011 All rights reserved Table 3-1 Event type Simple Events Tracking Events Condition Events Description Single signaling of events without condition such as a system message providing information on the failure of components.2 OPC Alarm & Events basics subscription. but all events are provided in the process and the client can limit the number of events by filter criteria. Alarm Client with OPC A&E V2.3 General Functional Mechanisms 3. If the condition of the process is normal. Table 3-2 describes the different properties.2 OPC Alarm and Events model Types of event messages OPC Alarm & Events defines three types of event messages that are described in Table 3-1. Conditions of alarm messages A status description (condition) for a part of a process has several properties that can trigger a condition change. If the defined condition changes to a fault condition. for instance. Figure 3-2 3. there is no explicit request of specific information when using OPC Alarm & Events.0. the condition is active.2. the condition is inactive. Alarm messages informing on the change of a condition in the process. ID Number: 26548467 17 .

for example a PLC or the specific block in this PLC that triggers the alarm.2 OPC Alarm & Events basics Table 3-2 Property Enabled/Disabled Description Indicates whether condition monitoring is active. Indicates whether the condition is normal. HI_HI for the violation of a critical high limit and accordingly LO and LO_LO for the underflow of the low limits. for example boiler1. condition monitoring is enabled and violations of the selected level limit values are provided. The areas can be structured hierarchically in a tree. be the case when the tank is emptied in order to clean it. If the limit values are violated. 18 Alarm Client with OPC A&E V2. OPC A&E offers the option to segment them into areas. for instance FIC1001. Subconditions can be defined for a condition. If the tank is in operation. If the tank level is within the limit values. The source is included in all event messages. Figure 3-3 shows the address space of the OPC Foundation sample server with areas.0. there are typically the HI conditions for a violation of the high limit. This property indicates whether the condition was acknowledged. For the level. the condition is inactive. Figure 3-3 Note SIMATIC NET A&E server version V7. If the server manages a large number of sources. ID Number: 26548467 .0 (CD 2008) and higher supports the optional interface for browsing. If the process is not active. This can. A source is typically a device. the limit values are not monitored. and sources. Active/Inactive SubCondition Acknowledged Sources for event messages Copyright  Siemens AG 2011 All rights reserved An OPC Alarm & Event server can manage several sources for event messages. for example.3 General Functional Mechanisms 3. the condition is active. The tree structure with the areas and sources can be determined using the optional IOPCEventAreaBrowser interface. An alarm typically requires an acknowledgement by the operator.

3 General Functional Mechanisms 3. ID Number: 26548467 19 . The event categories are defined by the server and allow a further subdivision of the event types defined by OPC Alarm and Events.0. Table 3-3 shows examples of event categories. followed by the CPU name and the program name and the block. it will not be used. Categories for event messages The OPC A&E server divides possible event messages into event categories.2 OPC Alarm & Events basics Note SIMATIC NET uses the configured S7 connections as sources for events. An event is forwarded to the client only if all of its criteria correspond to the filter values. The OPC A&E server does not have to support all filter criteria. The list of filters supported by the server can be determined by the client. Alarm Client with OPC A&E V2. Table 3-3 Event type Simple Event Tracking Event Copyright  Siemens AG 2011 All rights reserved Event category System message Device error System configuration Change default values Level alarm Deviation from setpoint System error Condition Event Filter options for event messages Filtering enables an OPC A&E client to determine which events it wants to receive and to thus adjust the number of delivered messages to its requirements. A list of event categories can be defined for each event type. thus the S7 connection name. If a filter criterion is not set by the client. The source name corresponds to the path to the block name that initiates the call. Table 3-4 describes the possible filter criteria. These default settings can be overwritten in the configuration and replaced by other texts.

Defines a list of possible event categories to be provided.0. Event Category Severity Area Source Copyright  Siemens AG 2011 All rights reserved 20 Alarm Client with OPC A&E V2. The possible areas are defined by the OPC A&E server. Defines the range of severity of events to be provided. ID Number: 26548467 . The possible sources are defined by the OPC A&E server. The event types given by OPC Alarm and Events are Simple. The possible range of values for the severity from 1 to 1000 is defined by OPC A&E. Defines a list of sources from which events are to be provided. Defines a list of areas from which events are to be provided.2 OPC Alarm & Events basics Table 3-4 Filter Event Type Description Defines which of the possible event types are to be provided. Tracking and Condition Events.3 General Functional Mechanisms 3. The event categories are defined by the OPC A&E server.

to set the filters on the subscription and to subsequently activate the subscription. For a subscription.3 General Functional Mechanisms 3. instant of condition change to active and a cookie that was supplied with the event are transferred for the identification. these associated values can be requested in addition to the default associated values. The aim is to prevent that a separate callback is sent for each event.3. The method provides a numeric ID and a description for each event category. For each attribute. properties such as active status. When creating the subscription. Source name. Using this method. The maximum number of events ensures that a callback is sent in any case when the defined number of events per callback is reached. QueryEventAttributes Copyright  Siemens AG 2011 All rights reserved CreateEventSubscription AckCondition Alarm Client with OPC A&E V2. the client can determine the available associated values for an event category. a description and the data type of the attribute. the method provides a numeric ID. A text ID. the filters supported by the server can be determined. it is advisable to create the subscription as inactive. 3.0. This method can be used to acknowledge a list of alarms requiring acknowledgement.1 Methods of the EventServer object The OPCEventServer object is generated by the connection establishment of the client in the OPC A&E server. Using this method.3 Functional mechanisms of OPC Alarm & Events 3.3 Functional mechanisms of OPC Alarm & Events This chapter explains the functional mechanisms of the OPC Alarm and Events interface that are necessary for the example. a subscription can be created in the server. This list enables the client to determine which event categories the server can send for the different event types. buffer time and maximum number of events per callback can be specified. Table 3-5 Method QueryAvailableFilters QueryEventCategories Description Using this method. ID Number: 26548467 21 . a comment for the acknowledgement and information for the identification of the alarm must be transferred for an alarm to be acknowledged. Table 3-5 explains the most important methods of this interface. This method provides the list of event categories for the transferred event type. condition name. This object enables the client to determine the server configuration via the IOPCEventServer interface and to create subscriptions. The buffer time indicates how long events are collected until a callback with a list of events is sent to the client. If filters are to be set for the subscription.

Messages before the instant are not sent and can be retrieved with Refresh only for active conditions. additional associated values can be selected for an event category. buffer time and maximum number of events per callback can be changed. If filters are to be set for the subscription.2 Methods of the EventSubscription object The OPCEventSubscription object is generated by calling the CreateEventSubscription method on the OPCEventServer object. This object enables the client to configure the properties and filters of the subscription via the IOPCEventSubscriptionMgt interface and. The aim is to prevent that a separate callback is sent for each event. to determine the currently active alarms from the server. The QueryAvailableFilters method enables the client to determine which filter criteria are supported by the server. severity. after creating the subscription. event categories. These associated values are then supplied in addition to the associated values defined by A&E if an event of the category is signaled. The maximum number of events ensures that a callback is sent in any case when the defined number of events per callback is reached. GetFilter SelectReturnedAttributes Copyright  Siemens AG 2011 All rights reserved Refresh SetState GetState 22 Alarm Client with OPC A&E V2. Table 3-6 explains the most important methods of this interface. The buffer time indicates how long events are collected until a callback with a list of events is sent to the client. After activating a subscription. the filter criteria for a subscription can be defined. The call of this method triggers event messages for all active conditions in the server. to set the filters on the subscription and to subsequently activate the subscription. the subscription properties such as active status. all event messages after this instant are sent to the client. it is advisable to create the subscription as inactive. The method must be called for each event category for which additional associated values are to be requested.3 General Functional Mechanisms 3.3. Using this method. This method provides the filter criteria that have been set for the subscription. ID Number: 26548467 .3 Functional mechanisms of OPC Alarm & Events 3. areas or sources. Possible filters are event type. the settings for the subscription such as active status. Using this method. Using this method. buffer time and maximum number of events per callback can be determined. Table 3-6 Methods SetFilter Description Using this method.0.

Additional associated values can additionally be requested depending on event categories.3 General Functional Mechanisms 3. but they supply additional associated values for the respective type. The subscription should be created as inactive. The SetFilter method on the subscription is used to make the filter settings. After activating.3. After registering the callback interface. The OPC Event Server object is generated during this process. Alarm Client with OPC A&E V2. ID Number: 26548467 23 . The OnEvent method is also used for signaling. Figure 3-4 shows the steps and objects involved in an overview. the OPC Event Subscription object is created in the server.3 Functional mechanisms of OPC Alarm & Events 3. the client can request the messages for the active conditions using the Refresh method. Step 4 – Sending the event messages After the subscription has been activated. the client can activate the subscription using the SetState method.0. the server uses the OnEvent method to send a respective list of event messages to the client. This callback interface is registered via the connection point container and the associated connection point in the Subscription object. the client can create a subscription. Table 3-7 describes these associated values. The other event types are also based on these associated values. • • • Associated values of Simple Events The OPC A&E specification defines a set of associated values that is provided by the server for Simple Events. During this process. the OPC A&E client must implement the IOPCEventSink interface with the OnEvent method. Step 2 – Creating a subscription Using the CreateEventSubscription method on the OPC Event Server object. Figure 3-4 Copyright  Siemens AG 2011 All rights reserved The four steps for registering are: • Step 1 – Establishing the connection to the OPC server COM mechanisms are used to establish the connection from the OPC A&E client to the server. Step 3 – Establishing the callback connection To receive the event messages.3 Receiving messages from the A&E server Register mechanism for events A client is registered for events in four steps.

Descriptive text for the event message. Event Category Severity Message Copyright  Siemens AG 2011 All rights reserved Associated values of Tracking Events The OPC A&E specification defines a set of associated values that is provided by the server for Tracking Events. for example. The list of event categories supported by the server with numeric ID and a description can be determined using the QueryEventCategories method on the Event Server object. Instant when the event has occurred. 1000 corresponds to the highest severity. by changing a setpoint.0. This set consists of the associated values defined for Simple Events and an additional associated value for Tracking Events.3 Functional mechanisms of OPC Alarm & Events Table 3-7 Associated value Source Time Type Description Name of the event message source. Additional associated values can additionally be requested depending on event categories. ID Number: 26548467 . Event type of the event message. The range of values of the severity is from 1 to 1000. this is the OPC client name that can be set when establishing the connection. Table 3-8 Associated value Actor ID Description Text ID identifying the application that has triggered the event. Table 38 describes this additional associated value. Value Meaning 1 Simple Event 2 Tracking Event 4 Condition Event Numeric ID of the event category defined by the server. 24 Alarm Client with OPC A&E V2. Severity of the event message.3 General Functional Mechanisms 3. If this application is an OPC client.

Bit number Meaning 0 Active status 1 Acknowledgement status 2 Enabled / Disabled 3 Quality of the value for condition monitoring 4 Severity 5 Subcondition 6 Message text 7 Additional attributes A bit mask indicating the condition status at the time of the event. Table 3-9 describes these additional associated values. This associated value is an empty string if the event is not triggered by an acknowledgement. Bit number Property Meaning when bit set 0 Enabled / Disabled TRUE = Enabled 1 Active status TRUE = Active 2 Acknowledgement status TRUE = Acknowledged Indicates the quality of the value on which the condition is based. for instance. this identification is necessary to acknowledge the alarm. This set consists of the associated values defined for Simple Events and additional associated values for Condition Events. Instant when the status of the condition has changed to active or the change to the current subcondition has occurred. A bit mask indicating which condition properties have changed and thus triggered the event. be the level of a tank. If the bit for the relevant property is set. If this application is an OPC client. this property is active. A server-defined cookie that uniquely identifies the event together with other parameters from the event. This can. Text ID identifying the application that has acknowledged the alarm.0. Table 3-9 Associated value Condition Name Sub Condition Name Change Mask Description Name of the condition at which a condition change has occurred. Name of the active subcondition within the condition. When calling AckCondition on the Event Server object.3 Functional mechanisms of OPC Alarm & Events Associated values of Condition Events The OPC A&E specification defines a set of associated values that is provided by the server for Condition Events. ID Number: 26548467 25 . A flag indicating whether the alarm must be acknowledged. Additional associated values can additionally be requested depending on event categories.3 General Functional Mechanisms 3. this is the text ID that is transferred when acknowledging with AckCondition. Copyright  Siemens AG 2011 All rights reserved New State Condition Quality Ack Required Active Time Cookie Actor ID Alarm Client with OPC A&E V2.

Configuring the settings for the transfer of messages. the messages are arranged in the list from bottom to top. Acknowledgement of alarms. Based on the instant they were received.4 Functionality of the Client Application 4. The list length is limited to 100 items. old messages are deleted. User interface of the application The following figure shows the user interface of the OPC client. context menu in the list or buttons): • • • Connecting to the set OPC A&E server. Selection and display of additional associated values. The following actions can be performed using the user interface elements (menu. Disconnecting from the OPC A&E server. Configuration of filter criteria to be able to limit the signaled events. The latest message is thus always displayed on the top of the list.1 Functionality of the alarm client 4 4. Figure 4-1 Copyright  Siemens AG 2011 All rights reserved Configuration of the OPC A&E communication The user interface is used to visualize the event and alarm messages and to change the settings for the number of delivered messages and their associated values.1 Functionality of the Client Application Functionality of the alarm client The OPC client application is used for the following tasks: • • • • Display of event messages and alarms of any OPC Alarm and Events servers. depending on the event categories provided by the server and their associated values.0. 26 Alarm Client with OPC A&E V2. ID Number: 26548467 .

NET accesses to the EventSubscription object of the OPC Alarm and Events COM interface (4). 4. Acknowledging alarm messages. When establishing the connection between user interface and OPC server. Table 4-1 No.4 Functionality of the Client Application 4. Figure 4-2 Process Copyright  Siemens AG 2011 All rights reserved Administration Administration OPC A&E interface Process Protocol layer / driver The following table explains the individual function blocks and steps. 1 Description When establishing the connection between user interface and OPC server. the filters for the messages are set and additional associated values are requested. Selecting additional associated values. ID Number: 26548467 27 .2 Functional mechanisms of the alarm client The figure below shows the function blocks in the OPC client and the interaction with the OPC server. The OPCEventServer object is generated in the server via the OPC A&E interface. This object encapsulates the . On the subscription. 2 3 4 Alarm Client with OPC A&E V2. a Server object is generated on the client side. This object encapsulates the .2 Functional mechanisms of the alarm client • • • Configuring the settings for the filters that are applied to the messages. a Subscription object is generated on the client side.0.NET accesses to the EventServer object of the OPC Alarm and Events COM interface (2). The OPCEventSubscription object is generated in the server via the OPC A&E interface.

4 Functionality of the Client Application 4. the client enters the messages in the list.2 Functional mechanisms of the alarm client 5 To be able to receive event messages from the server. Copyright  Siemens AG 2011 All rights reserved 28 Alarm Client with OPC A&E V2. A Callback object is created in the client and connected to the subscription in the server. a callback connection is established. When messages are sent from the server to the client.0. ID Number: 26548467 .

This class implements the dialog box for configuring the general subscription settings. The classes are divided into three modules: • OPC Alarm and Event Client API The module in the AEClientApi directory provides a .0. • • Copyright  Siemens AG 2011 All rights reserved Table 4-2 Class Server Subscription AreaBrowser EventNotification SampleClient EventView SubscriptionSettingsDlg FilterSettingsDlg AttributeSelectionDlg Alarm Client with OPC A&E V2. this . Sample application The sample application in the AEClient directory implements the OPC A&E client using the EventView and OPC A&E Client API modules. This class implements the dialog box for configuring the filter settings for the subscription.4 Functionality of the Client Application 4. This class implements the dialog box for selecting the additional associated values for the subscription. Task OPC A&E Client API OPC A&E Client API OPC A&E Client API OPC A&E Client API Sample application Display of events Sample application Sample application Sample application Description A wrapper class that encapsulates the OPCEventServer functionality and thus allows simplified access to the COM object via . The module can be used independently of the sample application.NET methods.NET interface for access to OPC A&E servers. ID Number: 26548467 29 .NET methods.NET Control displays event messages of OPC servers. This class encapsulates the data of an event. This class implements the functionality of the main dialog box of the sample application. This class implements the functionality to display event messages.3 Class diagrams of the alarm client This chapter explains the static structure of the OPC client using a UML class diagram.3 Class diagrams of the alarm client 4. A wrapper class that encapsulates the OPCEventSubscription functionality and thus allows simplified access to the COM object via . Event View Control Based on a subscription from the OPC A&E Client API. The module can be used independently of the sample application. The following table provides an overview of the most important C# classes and classifies them according to their tasks.NET methods. A wrapper class that encapsulates the OPCEventAreaBrowser functionality and thus allows simplified access to the COM object via .

Acknowledges one or several alarm messages. These event categories can be used for filtering. Provides the event categories that are provided by the OPC server. Establishes the connection to the server using COM mechanisms.NET API. The individual classes are explained in detail on the following pages.1 OPC Alarm and Event Client API The following class diagram shows the OPC A&E Client API classes. Provides the possible additional attributes that can be requested for an event category in a subscription.cs file in the AEClientApi module. Figure 4-3 Copyright  Siemens AG 2011 All rights reserved Server class The Server wrapper class described in the following table encapsulates the OPCEventServer functionality and thus allows simplified access to the COM object using C# methods. The class is implemented in the OpcAeServer. ID Number: 26548467 .0. Enables all COM interfaces of the server and thus terminates the connection 30 Alarm Client with OPC A&E V2. Enables all COM interfaces of the server and thus terminates the connection to the OPC server. These classes encapsulate the accesses to the COM interface in a . Provides the filter criteria that are accepted by the OPC server. Creates a subscription with the transferred settings.3.3 Class diagrams of the alarm client 4.4 Functionality of the Client Application 4. Table 4-3 Method Server Connect Disconnect CreateSubscription QueryAvailableFilters QueryEventCategories QueryEventAttributes AcknowledgeCondition Dispose Functionality Constructor for the Server class.

0.cs file in the AEClientApi module. the bottom or directly to a specific position. Table 4-4 Method Subscription SetFilters GetFilters SelectReturnedAttributes Refresh SetState Copyright  Siemens AG 2011 All rights reserved Functionality Constructor for the Subscription class. Using this method. the position in the address area where browsing takes place. The position can be changed using ChangeBrowsePosition.3. The BrowseDirection parameter indicates whether the position in the hierarchy is changed towards the top. BrowseFilterType can be used to determine whether areas or sources are provided.3 Class diagrams of the alarm client to the OPC server. Allows defined disconnecting from the subscription. all messages for currently active conditions can be requested. the callback connection to the OPC server is also established. GetState Dispose EventChanged AreaBrowser class The AreaBrowser class described in the following table is a wrapper class that encapsulates the OPCEventAreaBrowser functionality and thus allows simplified access to the COM object using C# methods. The class is implemented in the OpcAeSubscription. necessary to expand an Area filter. This is.4 Functionality of the Client Application 4. The mechanism for registering the callback to the OPC server is described in chapter 3. Provides areas or sources at the address area position where the AreaBrowser is located. Property of the class via which the delegate can be registered for event callbacks to the application. Sets the filter criteria to be used for the event messages of this subscription. ChangeBrowsePosition GetQualifiedAreaName GetQualifiedSourceName Alarm Client with OPC A&E V2. Sets the subscription settings. The class is implemented in the OpcAeAreaBrowser. Allows to get a name that is unique in the entire address area (fully qualified source name) from a source name (obtained through BrowseOPCAreas). for example. Table 4-5 Method AreaBrowser BrowseOPCAreas Functionality Constructor for the AreaBrowser class. When registering.3. Changes the current AreaBrowser position. Allows the selection of additional attributes for an event category and must be called for each event category. ID Number: 26548467 31 . Subscription class The Subscription class described in the following table is a wrapper class that encapsulates the OPCEventSubscription functionality and thus allows simplified access to the COM object using C# methods.e.cs file in the AEClientApi module. Provides the currently set filter criteria. for example active status. i. Provides the current subscription settings. The call of this method is necessary if the subscription is no longer required and if all COM interfaces of the subscription are to be enabled. Allows to get a name that is unique in the entire address area (fully qualified area name) from an area name (obtained through BrowseOPCAreas).

necessary to expand a Source filter. Copyright  Siemens AG 2011 All rights reserved 32 Alarm Client with OPC A&E V2.0. ID Number: 26548467 . for example.3 Class diagrams of the alarm client This is.4 Functionality of the Client Application 4.

the transferred event information for each event is packed in the EventNotification class and forwarded to the application via the EventChanged delegate.Callback class The Subscription.cs file in the AEClientApi module.3.0. Allows defined disconnecting from the AreaBrowser interface. Table 4-6 Copyright  Siemens AG 2011 All rights reserved Method OnEvent Functionality This method implements the callback interface for the signaling of events from the server to the client. Alarm Client with OPC A&E V2. The class is implemented in the OpcAeSubscriptionHelper.Callback class described in the table below is an internal utility class to implement the callback interface from the OPC server to the OPC client for signaling events.cs file in the AEClientApi module.3.4 Functionality of the Client Application 4. Subscription. ID Number: 26548467 33 . The class is implemented in the OpcAeSubscription. The conversion of the OnEvent callback to the EventChanged delegate of the subscription is realized in this class. EventNotification class The EventNotification class encapsulates the data of an event. When this method is called by the server. The properties of the class correspond to the associated values of the event messages described in chapter 3.3 Class diagrams of the alarm client Dispose The call of this method is necessary if the AreaBrowser is no longer required and if all COM interfaces of the AreaBrowser are to be enabled.

Opens the dialog box for the filter criteria settings and updates the filter criteria for the subscription. The class name corresponds to the file name in the AEClient module. Opens the dialog box for the subscription settings and updates the subscription settings. Deletes the subscription and disconnects from the server.3. These classes realize the functionality of the user interface and use the A&E Client API classes. Acknowledges an alarm. 34 Alarm Client with OPC A&E V2.2 OPC A&E client sample application The following class diagram shows the classes of the OPC A&E sample client.3 Class diagrams of the alarm client 4.4 Functionality of the Client Application 4.0. Table 4-7 Method OnConnect OnDisconnect OnSubscriptionSettings OnSubscriptionFilterSettings OnSelectAttributes OnAcknowledgeAlarm Functionality Implements the functionality to connect to the server. ID Number: 26548467 . The individual classes are explained in detail on the following pages. Figure 4-4 Copyright  Siemens AG 2011 All rights reserved SampleClient class The SampleClient class described in the following table implements the main dialog box functionality of the client application. to query the settings for the subscription and to create the subscription. Opens the dialog box for selecting the attributes.

the new filter settings for the subscription are read out of the dialog box and returned. ShowDialog FilterSettingsDlg class The FilterSettingsDlg class described in the table below implements the dialog box for configuring the filter settings for the subscription. AttributesDlg class The AttributesDlg class described in the following table implements the dialog box for selecting the additional associated values for the subscription. ID Number: 26548467 35 .4 Functionality of the Client Application 4. Table 4-11 Method ShowDialog Functionality Transfers the saved filter settings to the dialog box and displays the dialog box.0. Table 4-8 Method SetSubscription DeleteSubscription OnEventChanged Functionality Sets the subscription for EventView and registers the callback for EventView. Table 4-9 Method Copyright  Siemens AG 2011 All rights reserved Functionality Transfers the current status of the subscription to the dialog box and displays the dialog box. The class name corresponds to the file name in the AEClient module. The class name corresponds to the file name in the AEClient module. Receives new events and enters them in the list. the new settings for the subscription are read out of the dialog box and returned. Table 4-10 Method ShowDialog Functionality Transfers the current filter settings of the subscription to the dialog box and displays the dialog box. When closing the dialog box with OK. Alarm Client with OPC A&E V2. Deletes the subscription. SubscriptionSettingsDlg class The SubscriptionSettingsDlg class described in the following table implements the dialog box for configuring the general subscription settings.3 Class diagrams of the alarm client EventView class The EventView class described in the table below implements the functionality to display event messages. The class name corresponds to the file name in the EventView module. When closing the dialog box with OK. The class name corresponds to the file name in the AEClient module. the selected attributes are read out of the dialog box and returned. When closing the dialog box with OK.

4 Sequence diagrams of the alarm client 4. This action can be started using the Connect button on the user interface or via the Server menu.4 Sequence diagrams of the alarm client The following sequence diagram shows the sequences when the user of the application performs the “Connect Server” action to establish the connection to the OPC server.4 Functionality of the Client Application 4.0. Connecting to the OPC server Copyright  Siemens AG 2011 All rights reserved 36 Alarm Client with OPC A&E V2. ID Number: 26548467 .

0.4 Sequence diagrams of the alarm client Figure 4-5 1 2 Copyright  Siemens AG 2011 All rights reserved 3 4 5 6 7 8 9 10 Alarm Client with OPC A&E V2. ID Number: 26548467 37 .4 Functionality of the Client Application 4.

The dialog box for the filter settings is generated and initialized with the information from the server. The dialog box uses the AreaBrowser to recursively retrieve all areas and sources on the server. Default values are transferred as a status. Subsequently. The subscription activates the callback connection to the OPC server. the filter settings for the subscription are made on the Subscription object using the SetFilter method. QueryEventCategories is called for each event type. The QueryAvailableFilters and QueryEventCategories methods on the Server object are used to determine the necessary configuration parameters for the filter dialog box by the OPC server. An AreaBrowser is created. ID Number: 26548467 . the settings are determined from the dialog box. Using the CreateSubscription method on the Server object. a subscription is created as inactive. This ensures that the connection to the OPC server defined by the URL is established. The dialog box for the subscription settings is created and initialized using the SubscriptionSettings auxiliary function of the SampleClient class. the Server object from the Client API is created and the Connect method on the Server object is called. By calling the Refresh method on the subscription. the dialog box for the settings opens to enable the user to make the desired settings. By calling the SetState method on the Subscription object. 2 3 4 5 Copyright  Siemens AG 2011 All rights reserved 6 7 8 9 10 38 Alarm Client with OPC A&E V2. the dialog box for the filter settings opens to enable the user to select the desired filters. the subscription is activated with this call and events can be sent from the server to the client. these messages are delivered to the client via the callback mechanism. When the user closes the dialog box.4 Sequence diagrams of the alarm client Table 4-12 No.4 Functionality of the Client Application 4. the settings are determined from the dialog box. the messages for active conditions are requested from the server. After creating the subscription and establishing the callback connection. In this method. The configuration parameters determined in step 3 and blank filter settings are transferred. It is transferred to FilterSettingsDlg to browse for areas and sources on the server and to display them to the user. Like all other event messages. the desired status of the subscription is set. In the first step. The actions for connecting to the server and creating the subscription are performed in this method. EventView connects the Callback method in the EventView object to the delegate of the subscription. The subscription created in step 5 is transferred to the EventView object with SetSubscription.0. 1 Description The OnConnect method on the SampleClient object is called by the “Connect Server” user action. When the user closes the dialog box. If the user has configured the subscription as active. Subsequently.

2 Alarm Client with OPC A&E V2. In this method. In this method.0. the Disconnect method on the AeServer object is called. In the second step. This is done by calling the DeleteSubscription method on the EventView object that calls the Dispose method on the AeSubscription object. Figure 4-6 1 2 Copyright  Siemens AG 2011 All rights reserved Table 4-13 No. ID Number: 26548467 39 . which clears the connection. which deletes the subscription. the COM interfaces of the Subscription object are enabled in the OPC A&E server. This action can be started using the Disconnect button on the user interface or via the Server menu. 1 Description The OnDisconnect method on the SampleClient object is called by the “Disconnect Server” user action.4 Sequence diagrams of the alarm client Disconnecting from the OPC server The following sequence diagram shows the sequences when the user of the application performs the “Disconnect Server” action. the subscription is deleted in the server. the COM interfaces of the Server object are enabled in the OPC A&E server. In the first step.4 Functionality of the Client Application 4. The actions for deleting the subscription and disconnecting from the server are performed in this method.

The current subscription settings are transferred as a status. ID Number: 26548467 . Subsequently. When the user closes the dialog box. the settings are determined from the dialog box.4 Functionality of the Client Application 4.0. Figure 4-7 1 2 3 Copyright  Siemens AG 2011 All rights reserved 4 5 Table 4-14 No. the dialog box for the settings opens to enable the user to make the desired settings. The current subscription status is read out using the GetState method. 4 5 40 Alarm Client with OPC A&E V2. The dialog box for the subscription settings is created and initialized using the SubscriptionSettings auxiliary function of the SampleClient class. 1 2 3 Description The OnSubscriptionSetting method on the SampleClient object is called by the “Change Subscription Setting” user action. The SetState method is used to change the subscription status to the new settings. This action can be started via the Subscription menu.4 Sequence diagrams of the alarm client Changing the subscription settings The sequence diagram below shows the sequences when the user of the application performs the “Change Subscription Settings” action.

The method is called for each event type.0. the event categories are determined from the server.4 Functionality of the Client Application 4.4 Sequence diagrams of the alarm client Changing the subscription filters The sequence diagram below shows the sequences when the user of the application performs the “Change Subscription Filter” action. The GetFilters method is used to read the current filter configuration from the server. Figure 4-8 1 2 3 Copyright  Siemens AG 2011 All rights reserved 4 5 6 8 7 9 Table 4-15 No. Using the QueryEventCategories method. 1 2 3 4 Description The OnSubscriptionFilterSetting method on the SampleClient object is called by the “Change Subscription Filter” user action. The FilterSettings auxiliary function is used to determine the new settings. QueryAvailableFilters Alarm Client with OPC A&E V2. ID Number: 26548467 41 . This action can be started via the Subscription menu.

Copyright  Siemens AG 2011 All rights reserved 42 Alarm Client with OPC A&E V2.0. When the user closes the dialog box. The information determined in step 2. ID Number: 26548467 . It is transferred to FilterSettingsDlg to browse for areas and sources on the server and to display them to the user. step 3 and step 4 is transferred. The SetFilter method is used to change the subscription filter settings to the new settings. the settings are determined from the dialog box. Subsequently. the dialog box for the filter settings opens to enable the user to select the desired filters. The dialog box uses the AreaBrowser to recursively retrieve all areas and sources on the server.4 Functionality of the Client Application 4.4 Sequence diagrams of the alarm client is used to query the possible filter settings from the server. The dialog box for the filter settings is generated and initialized with the information from the server. 5 6 7 8 9 An AreaBrowser is generated.

only STEP 7 (STL and symbol table) is used for the configuration. The message number procedure is examined.0. The message texts of the message number procedure are generated from a shared database. programming via alarm signaling blocks. http://support. configuration via the symbol table (only S7-400).1 Extended alarm configuration for STEP 7 V5. which.siemens. actually actively throws events out of the automation system and thus causes a significantly lower bus load. The actual configuration is not new.5 or higher.5 and higher This chapter explains the concepts of the alarm signaling procedure and the basic steps for its configuration.automation. when using STEP 7 V5. additional texts can be configured and the messages include the time stamp from the automation system.1 and higher) when “saving and compiling”. the OPC Alarm&Event server also knows the configuration and displays message texts. but. User-defined messages Signaling of program-synchronous diagnostic events.msg) that was necessary in earlier OPC A&E server versions is thus no longer necessary and the configuration is continuous and consistent. When the PC station containing the OPC server is loaded (or XDB import). Symbol-related messages Signaling of program-independent events. • • Configuration STEP 7 supports the configuration of the message number procedure with the following languages or tools: • • • • • LAD/FBD/STL/SCL Symbol table PDIAG CFC S7-GRAPH In this example. Copyright  Siemens AG 2011 All rights reserved Introduction Basically. sources and areas as OPC attributes.5 and higher 5 Explanation of the S7 Sample Program The type and number of alarms supported by an S7 CPU depend on its type and firmware version. ID Number: 26548467 43 . programming via system functions. the configured alarm information is edited for the SIMATIC NET OPC server (V7.com 5. The configuration using an additional file (scores7.1 Extended alarm configuration for STEP 7 V5.5 Explanation of the S7 Sample Program 5. ID Number: 841294 on the Customer Support website provides an overview. there are three different types of messages that differ in their area of application: • Block-related messages Signaling of program-synchronous events. Alarm Client with OPC A&E V2. unlike the bit message procedure in which the operating system or the OPC server monitors individual bits on a polling basis.

e. The messages of these instances look exactly as defined in the message type. A respective alarm type is generated. The instance is configured in the Simatic Manager: Right mouse button on the DB (multi-instance DB of the FB).0.> (not “0”) column indicates that it is a configuration of the instance.5 Explanation of the S7 Sample Program 5. the parameters that have not been locked can now be filled. supplied with respective formal parameters. ID Number: 26548467 . the structure of analog measuring points is always identical with regard to their alarms and the measuring points provide alarms whenever a limit value is exceeded or fallen below.5 and higher Block-related messages The alarm signaling block is the most frequently used alarm. 44 Alarm Client with OPC A&E V2. DB200). This type can now be configured in STEP7 and the properties can be defined and even locked. Figure 5-1 Copyright  Siemens AG 2011 All rights reserved Configuring the type and locking the parameters is used when you want to use a block to signal events that are always identical. of which instances will be generated later in the program. Special Object Properties Message… and the dialog box for configuring the type opens. the structures of these instances are always identical. Special Object PropertiesMessage… and the dialog box for configuring the instance opens. called.1 Extended alarm configuration for STEP 7 V5. an instance data block is generated (Call FB200. for example. a threshold value is exceeded or fallen below and a general error interrupt if the measuring point is faulty. For example. i. which differ in the number of monitored signals. The message number=<no. When calling the FB in OB1. Different blocks (SFB/SFC) exist. Each of these blocks represents a message type once it is. On the instance. the number of associated values and the acknowledgement capability. The type is configured in the Simatic Manager: Right mouse button on the FB (that calls the SFB). the instance-specific parameters. The message number=0 column indicates that it is a configuration of the type. in an FB and thus represents a message-type FB.

all other parameters for this instance have already been changed. loads the CPU cycle time and is possible only when using the S7-400. ID Number: 26548467 45 . 255 event numbers are available for each of the two error classes (A and B).g.1 Extended alarm configuration for STEP 7 V5. After completing the configuration in the symbol table. The time interval depends on the CPU type. 500. in this case. user entries are written to the diagnostic buffer of the CPU and a message is simultaneously sent. User-defined messages Using the SFC52 (WR_USMSG) system function. In the user program.0. This message type is thus used exclusively for system-relevant events. asynchronous means asynchronous to the OB1 cycle. in OB100. the configured “scan alarm” is initiated. outputs and flags). All binary symbols can be monitored (inputs. Symbol-related messages The symbol-related message is used rarely and only to monitor asynchronous events. this bit is monitored at a fixed interval (100. 1000 ms) (SCAN). It uses up system resources.5 Explanation of the S7 Sample Program 5. the warm start OB) and provided with the desired event ID (0xA101). Monitoring of a binary signal is configured using the symbol table. the system function (Call SFC 52) is called at an appropriate location (e. Alarm Client with OPC A&E V2.5 and higher Figure 5-2 Copyright  Siemens AG 2011 All rights reserved Parameters that still correspond to the ones of the original type are displayed in green.. system blocks (SDB) have to be generated and loaded to the controller. This alarm can contain up to 10 associated values. Once a signal change is detected. Independently of the OB1 cycle. for which one text can be configured for an incoming message and one can be configured for an outgoing message.

2 Alarms of the SIMATIC S7 station This chapter shows the possible event messages of a SIMATIC S7 station and describes their display in OPC Events (SIMATIC NET V8. ID Number: 26548467 .5 Explanation of the S7 Sample Program 5. the user assigns event numbers and calls SFC 52 in the program. When using “Report System Error”. Categories Event messages that can be signaled by an S7 station are divided into ten categories: • • • • • • • • • • System message Programmed alarm (off normal) Programmed alarm (level) Programmed alarm (deviation) Programmed alarm (rate of change) Programmed alarm (trip) Programmed alarm (change of state) Programmed alarm (device failure) Programmed alarm (system failure) Connection alarm (statepath) 46 Alarm Client with OPC A&E V2.2 Alarms of the SIMATIC S7 station Figure 5-3 Copyright  Siemens AG 2011 All rights reserved Unlike the “Report System Error” function.0.0) in greater detail. the numbers (a special number range) and also the texts are specified by the system or compiled during the call by determining diagnostics information. 5.

Where possible. The use of these alarms is not recommended and should be disabled in the S7 connection configuration (NetPro). Note Disable simple alarms in the connection configuration (NetPro) to avoid “double” signaling of the same event.0. Event types The OPC Alarm & Events specification defines three types of events. The figure below shows the disabling of the alarms of the “SIMATIC S7 simple alarm” type in the Properties dialog box of the connection configuration.2 Alarms of the SIMATIC S7 station Note Categories 2 to 14 were used in SIMATIC NET version < V8. ID Number: 26548467 47 . use ALARM_D and the acknowledgeable ALARM_DQ variant instead of the older variants. Categories 40 to 60 are used in version V8.0 and higher. respective alarms are sent as conditional events and it is absolutely necessary to avoid “double” sending. the SIMATIC NET OPC server supports two of these types.1 Diagnostic event (system message) System message Programmed alarms (all) Connection alarm (statepath) Not supported Copyright  Siemens AG 2011 All rights reserved Simple alarms The SIMATIC NET A&E OPC server offers simple alarms of the “SIMATIC S7 simple alarm” type with clearly reduced information contents only for compatibility reasons with earlier SIMATIC NET software versions.5 Explanation of the S7 Sample Program 5. The events are displayed as shown in the following table: Table 5-1 OPC event type Simple Events Conditional Events Tracking Events OPC. Alarm Client with OPC A&E V2. Nowadays.SimaticNETAlarms.0.

the WR_USMSG function is called. The respective error OBs are called and the hexadecimal ID number of the diagnostic event enables the user to determine the cause using the module description (for example. The following table contains all block-related S7 events. System messages Events of the system error message class (formerly diagnostic events) are independently triggered by the S7 CPU or CP or the I/O module (e. insert/remove interrupt. Hence the name “SIMATIC S7 programmed alarm”.). which has previously been configured with text messages for an incoming and an outgoing event. In the user program. Scope and type of these SFC depend on the respective S7 CPU type. ID Number: 26548467 . I/O access error. the SIMATIC S7 controller family offers system function blocks (SFB/SFC) that are capable of sending events via the S7 protocol. etc. SIMATIC NET V8.2 Alarms of the SIMATIC S7 station Figure 5-4 Copyright  Siemens AG 2011 All rights reserved More recent OPC server versions.5 Explanation of the S7 Sample Program 5.0 or higher. no longer have this setting since block messages are no longer sent as Simple Events. restart. The listed blocks differ in the number of channels (number of monitored signals) and the number of possible associated values that 48 Alarm Client with OPC A&E V2.g.. DP slaves or PNIO device) and filled in the diagnostic buffer of the relevant component.. These blocks must be called in the S7 control program (e. cold restart/warm restart request. It lists the names of the blocks and their core functions.0. i. STL code) to trigger a respective alarm.e. Events of the user-defined diagnostic messages (SFC52) class are always entered in the diagnostic buffer of the CPU and can additionally be made available as a system message via OPC.g. Programmed alarms As a part of the operating system.

CP goes to stop or a cable is removed) is detected by the OPC server. acknowledgeable. its status and time stamp are kept in the memory and can. up to 10 associated values 1 channel. Once the state machine has been completely processed. the S7 CPU “forgets” this alarm and releases the resource. The duration of a pending alarm is referred to as an alarm cycle. This is cyclic monitoring of individual binary signals (input. ID Number: 26548467 49 . it is therefore also referred to as a “configured” alarm (in contrast to the “programmed alarm”). be queried by a refresh.0. acknowledgeable. 1 associated value 1 channel. non-acknowledgeable. the alarm occupies system resources. Thus no history is kept in the controller. No program block is called for the SCAN alarm. Note SIMATIC S7-300 supports only ALARM_S and ALARM_D and the acknowledgeable ALARM_SQ and ALARM_DQ variants. Table 5-2 Event ALARM_8 (SFB34) ALARM_8P (SFB35) NOTIFY (SFB36) ALARM (SFB33) ALARM_S (SFC18) ALARM_SQ (SFC17) AR_SEND (SFB37) NOTIFY_8P (SFB 31) ALARM_DQ (SFC 107) ALARM_D (SFC 108) Copyright  Siemens AG 2011 All rights reserved Description 8 channels. up to 10 associated values 1 channel. non-acknowledgeable. non-acknowledgeable. a respective alarm is generated and sent to all accordingly registered clients. 1 associated value The S7-300 does not have the full scope of alarm functions. an acknowledged alarm event has “gone” and the SIG input has accordingly fallen to “low” (false). some alarms can be acknowledged. Furthermore. the so-called symbolic message. acknowledgeable. Each time the status of one of the monitored channels changes. for example. up to 10 associated values 1 channel.5 Explanation of the S7 Sample Program 5.2 Alarms of the SIMATIC S7 station can be included in the transfer. others cannot. Connection alarms The connection or statepath alarm class is not initiated in the S7 station but in the actual OPC A&E server. thus the time between rising and falling edge of the signal input while the signal input (SIG) of the block has the “high” (true) status. output and flag). no associated values 8 channels. 1 associated value For sending archives 8 channels. During this time. i. non-acknowledgeable. an alarm is triggered and sent (rising and falling edge of a channel input form an incoming and an outgoing event). 1 associated value 1 channel. Alarm Client with OPC A&E V2. The SCAN alarm is configured using the symbol table and should be used “economically” since it loads the system due to the cyclic test. acknowledgeable. up to 10 associated values 1 channel. acknowledgeable. the S7-400 offers the SCAN alarm. In addition to the programmed alarms described above. A failure of an S7 connection or an interruption of the connection (for example.e.

44=Trip. 47=SystemFailure. The text can be changed via STEP7 when using version 8. there are attributes that can be optionally (manufacturer-specifically) included. 60=SystemMessage <1.0 or higher. Time Type Category Severity Message Note For some blocks.1000> (default=500.3 Display of attributes in OPCEventNotification The OPC Alarm & Events specification defines attributes that must be contained in an OPC event notification and attributes that have to be additionally included depending on the alarm type (event type). “Message” and “Time” can also be filled with different contents using configuration options. (See chapter 5. ID Number: 26548467 . the severity (0-16) is specified directly at the block in the S7 program. ALARM_8P or NOTIFY. The highest block severity “0” corresponds to the highest OPC severity “1000”. 40=Level.. can be set via NetPro.3 describes the configuration. ALARM_S/D and ALARM_SQ/DQ have no severity so that the configured message weights are always used. The alarm severities for specific alarm numbers configured in NetPro win through against the general default severity for alarm messages and also against programmed message weights. 43=OffNormal. 46=DeviceFailure.3. This chapter describes the OPC attributes and their contents according to the S7 alarms. Some attributes such as “Source”. “Area”. e.g. S7 connection configuration or directly when calling the block) <Text#> The text corresponds to the condition and EventID. Furthermore.5 Explanation of the S7 Sample Program 5.) Default attributes of OPCEventNotification The following table shows all default attributes that are provided with each event: Table 5-3 OPC attribute Source Area Copyright  Siemens AG 2011 All rights reserved Content (description) <ConnectionName\PathToBlock> (can be changed in the STEP7 block configuration) <ConnectionName\PathToBlock> (can be changed in the STEP7 block configuration) <S7 time when the alarm was called> (can be changed in the NetPro S7 connection configuration. 50 Alarm Client with OPC A&E V2. 42=RateOfChange. ALARM. 45=ChangeOfState. this severity wins through against the default priority for alarm messages that can be configured in NetPro and is automatically converted to OPC severity (1000-1) according to linear conversion. Chapter 5. 41=Deviation. note: PC time in UTC is provided only for statepath) <SIMPLE> or <CONDITION> (no Tracking Events) <Number> 14=Statepath. It describes the default selections of these attributes.3 Display of attributes in OPCEventNotification 5.0.

Table 5-4 OPC attribute ConditionName SubConditionName ActiveTime Content (description) <FixedText#> (default text.0 no longer includes Category 2 alarms. their attributes are not described in detail at this point. consisting of Category & EventID) <ConditionName> if this alarm has no SubCondition.5 Explanation of the S7 Sample Program 5. Table 5-6 Attribute ID 0xFF FF FF FB 0xFF FF FF FA 0xFF FF FF F7 Content = example (description) <Event Type> (VT_I4) <Severity> (VT_I4) =“32” (conditional) =“500” =“43” <Category Identifier> (VT_I4) Alarm Client with OPC A&E V2. otherwise <SubconditionName> <S7 time when the condition has occurred> (PC time in UTC is provided for statepath alarms) Attributes for Category 2 (Alarm) Version 8. ID Number: 26548467 51 . Category 60 system messages provide additional information as shown in the following table: Table 5-5 Attribute ID 0xFF FF FF FB 0xFF FF FF FA 0xFF FF FF F7 0xFF FF FF F6 0x00 00 17 70 0x00 00 17 71 0x00 00 17 A0 0x00 00 17 A1 0x00 00 17 A2 0x00 00 17 A3 Content = example (description) <Event Type> (VT_I4) <Severity> (VT_I4) =“16” (simple) =“500” =“60” <Category Identifier> (VT_I4) <Category Description> (VT_BSTR)=“SIMATIC S7 diagnosis event” <PC Time> (VT_Date) <S7 Time> (VT_Date) <Diagnostic ID> (VT_I4) =“12345” (decimal) <Diagnostic Data> (Array of VT_UI1)=“255|70|199|114|67|4|8|20|23|20” <S7ConnectionName> (VT_BSTR) =“S7Conn” <Areas> (Array of VT_BSTR) = [“”] Attributes for Category 40 to 47 (Programmed) In manufacturer-specific attributes. Up to 10 associated values (each with data type.0.3 Display of attributes in OPCEventNotification Additional attributes of OPCEventNotification for conditional events The following table shows attributes that are provided for “conditional events” in addition to the ones shown table 5-3. therefore. length and the actual data) can be included in EventNotification as attributes. Category 40 to 47 programmed alarms provide additional information as shown in the following table. Attributes for Category 60 (System Message) Copyright  Siemens AG 2011 All rights reserved In manufacturer-specific attributes.

3 Display of attributes in OPCEventNotification Attribute ID 0xFF FF FF F6 0x00 00 17 70 0x00 00 17 71 0x00 00 17 72 0x00 00 17 73 0x00 00 17 74 0x00 00 17 75 0x00 00 17 76 0x00 00 17 77 0x00 00 17 78 to 0x00 00 17 9C 0x00 00 17 9E 0x00 00 17 9F Copyright  Siemens AG 2011 All rights reserved Content = example (description) <Category Description> (VT_BSTR)=”SIMATIC S7 programmed alarm” <PC Time> (VT_Date) <S7 Time> (VT_Date) <Status> (VT_UI2) =“0” <Acknowledgement Status> (VT_UI2) =“256”(unack).“257”(ack) <Event State> (VT_UI2) =“0” <# Additional Data> (VT_UI2) =“1” <Data Type> (VT_UI2) <Length> (VT_UI2) <Data> (array of VT_UI1) <DataType><Length><Data> (one triple per associated value.5 Explanation of the S7 Sample Program 5. Table 5-7 Attribute ID 0x00 00 00 05 0x00 00 00 06 0x00 00 00 09 0x00 00 00 0A Content = example (description) <Event Type> (VT_I4) <Severity> (VT_I4) =“32” (conditional) =“500” =“14” <Category Identifier> (VT_I4) <Category Description> (VT_BSTR)=“SIMATIC S7 statepath alarm” 52 Alarm Client with OPC A&E V2.0. as above) <Event ID> (VT_UI4) <Subevent ID> (VT_UI4) =“5” =“3” Attributes for Category 14 (Statepath) In manufacturer-specific attributes. Category 14 connection alarms provide additional information as shown in the following table. ID Number: 26548467 .

The necessary STL code fragment is executable in the S7-300 and the S7-400 and thus used here as a general example. as far as possible.4 User program of this example 5. Initially.5 Explanation of the S7 Sample Program 5. executable in all S7 CPUs and that illustrates the basic functions of “programmed alarms” was selected for this application example.0. the S7 program consists of two parts.4 User program of this example A block call that is. the status word was not evaluated. Introduction User program Basically. Figure 5-5 Copyright  Siemens AG 2011 All rights reserved Alarm Client with OPC A&E V2. For reasons of clarity. the binary signals for the alarms are simulated and then the signals are allocated to the alarm blocks and called in FB 200. ID Number: 26548467 53 .

ALARM_8P The alarm block has 8 signal inputs and 10 possible associated values.0. It is equipped with 8 signal bits from DB11 and the associated values from DB20. The data rate of change can be set via DB11 byte 0.5 Explanation of the S7 Sample Program 5.4 User program of this example Simulation of binary signals The table below provides a brief overview of the program parts and their function for the signal simulation. SimulationAlarms Contains global variables to configure the data simulation. a variable timer is set here. which are to be sent with triggered alarms. AssociatedValues Contains several associated values as examples. ID Number: 26548467 . It was a deliberate decision to avoid details. SFB35 + multi-instance DB200 SFC107 54 Alarm Client with OPC A&E V2. It was a deliberate decision to avoid details. FC15 DB11 DB20 Copyright  Siemens AG 2011 All rights reserved Programmed alarms The table below provides a brief overview of the program parts and their function for the signal simulation.0 (symbolic message). Table 5-9 Block OB1 Comment Cyclic Main Call of the alarm block (SFC107) for ALARM_DQ and the alarm block (SFB35) for ALARM_8P using function block 200. ChangeSignalBits Toggles Boolean variables in DB11 and flag bit 20. SFB35 exists only in the S7-400. ALARM_DQ The alarm block has a signal input and can provide an associated value. whose interval is used to call the other program functions. Table 5-8 Block OB1 Comment Cyclic Main Initially. further comments can be found in the STL code. further comments can be found in the STL code.

green checkmark if the alarm has been acknowledged). The status of an OPC alarm can only change within the scope of the state machine specified by OPC.. pending alarm is “red”) or to display specific symbols (for example. When the alarm is acknowledged while the signal is present (t4).g. Figure 5-6 Copyright  Siemens AG 2011 All rights reserved Each status change at one of the signal inputs of the alarm block triggers a notification.4 User program of this example Signal status overview The graphic representation below shows the most important signals of the block calls in the user program according to the above example and the associated response of the Simatic NET OPC A&E server. Simultaneously the alarm enters a new signal cycle (here: t3: SIG = 1) and is signaled as “came in” (SIG = 1). When an alarm comes in (t1: SIG = 1) and goes out without being acknowledged (t2: SIG = 0). Alarm Client with OPC A&E V2.0 and later. The A&E client of this application example uses this information to color the alarms in the view (e.5 Explanation of the S7 Sample Program 5. ID Number: 26548467 55 . The current status of each notification can be read out via a bit mask. this alarm is implicitly signaled as acknowledged the next time it occurs. Implicit acknowledgement is no longer signaled when using CD 2010 V8. an active.0. the OPC server provides an acknowledgement notification (ACKED).

5 Sample configuration of a SCAN alarm 5. Action Initially. The limit switches of the doors. however.5 Explanation of the S7 Sample Program 5. accordingly. Introduction Note Symbol-related messages (SCAN) are only available in S7-400 CPUs. temperature monitoring of the drive motor would be monitored using a Scan alarm. 1. for example. If. Copyright  Siemens AG 2011 All rights reserved Table 5-10 No. would be displayed with programmed alarms (SFC) since they directly influence the program flow. they are particularly suitable for events that are not directly linked to the program flow. A flag bit that represents the signal to be monitored and a flag word that is to be used as an associated value. 56 Alarm Client with OPC A&E V2. Procedure For symbolic messages. the Symbol Editor is opened in STEP7 and two symbols are added. The following sections describe a sample configuration of a SCAN alarm to explain the basic procedure. Therefore. These SCAN alarms are configured using the symbol table of STEP 7. ID Number: 26548467 . these blocks and the PC station (OPC server) must be downloaded when changes are made. Comment After creating the symbols. They are transferred via system data blocks (SDB). the symbol file must be saved. the S7 program represents a step sequence to control a freight elevator.5 Sample configuration of a SCAN alarm The S7-400 offers the option to configure symbol-related messages. binary signal statuses are checked acyclically to the program execution at a fixed interval.0.

ID Number: 26548467 57 .0. Alarm Client with OPC A&E V2. please refer to the STEP7 online help. they must be put into “@”. The wildcard is edited according to the desired format. filters can be set to make it easier to find the desired associated values. for a better overview. The entered Message text and Info text can also comprise multiple lines. followed by the number of digits and the format qualifier. 2. In the “SCAN attributes” tab. Up to 10 associated values can be configured.5 Sample configuration of a SCAN alarm No.5 Explanation of the S7 Sample Program 5. The configuration dialog box of the Message Configuration displays the extended view. 5. For a detailed description. Comment 3. The SCAN interval is preset to 500 ms. Action Right-click on the symbol to be scanned (here: “Scan_Signalbit”) and select “Special Object PropertiesMessage…” to display the configuration dialog box. If associated values are to be displayed in the Message text. Copyright  Siemens AG 2011 All rights reserved 4. of the associated value><element type><format>@ The format starts with “%”. The wildcard structure is as follows: @<No. the associated value is configured.

symbolic messages. 7. ID Number: 26548467 . Please note that the SCAN function loads the system and should therefore only be used to a small extent. Other settings such as Alarm class and Severity can be made separately for each Scan alarm. Comment Unlike programmed alarms. The “Source” OPC attribute is created from the first additional text and the “Area” attribute is created from the second additional text. up to 9 additional texts can be entered.. in NetPro) and then downloaded again. “8” is set here to obtain a mean value of 500 as OPC severity.g. a low value also means low priority for configured. The configured signals are checked asynchronously to the running program.0. Copyright  Siemens AG 2011 All rights reserved After completing the configuration of the SCAN alarms. Action In the “Additional text” tab. Priority can be set between “0” and “16”. The green flag indicates that a Scan alarm has been configured for this symbol. 58 Alarm Client with OPC A&E V2. “Warning – high” is set here as an example. Note The PC station (OPCServer) must also be recompiled (e.5 Sample configuration of a SCAN alarm No. the system data blocks (SDB) must be generated and loaded to the S7-400. 6. Note System data blocks are generated for each configured SCAN rate.5 Explanation of the S7 Sample Program 5.

a call in the time-controlled OB35 or other OBs (e. The call parameters are explained as examples and their meaning for OPC Events is explained.5 Explanation of the S7 Sample Program 5. OB40) is advisable. Introduction Note The block is only available in S7 400 CPUs. Copyright  Siemens AG 2011 All rights reserved The figure below shows the block call in STL code of an S7-400. This block provides the maximum functionality possible with regard to Alarm and Events. If the SFB is called within an FB. ID Number: 26548467 59 ..g. error bit and status word were not evaluated.6 Sample call of an ALARM_8P 5. S7_server and S7_a_type) and the respective values are automatically assigned once a symbolic IN parameter has been created and specified on the SFB call.. Note To demonstrate the functionality. the parameters can be stored in the multi-instance DB. In CPU Configuration (HW Config). For a detailed description of the parameters.0.6 Sample call of an ALARM_8P The most frequently used alarm block in S7-400 stations is SFB35 (ALARM_8P). For reasons of clarity. The required system attributes (e. An instance data block (here: DB35) is generated that contains the local data of the call.g. this is the only way to ensure that ALARM_8P actually sends alarms. the block is called cyclically in OB1 as an example. the “Acknowledgement Triggered Reporting” setting has to be disabled. Figure 5-7 Signal input of the monitored binary signal Any pointers to associated values Alarm Client with OPC A&E V2. please refer to the STEP7 online help. Depending on the desired application.

ID Number: 26548467 . Note All currently pending associated values are always included in the sending. irrespective of the specific channel (signal input) that triggered the alarm. Management parameters The event number (EV_ID) uniquely identifies the block for the entire controller and is assigned by Step7 to ensure consistency (“0” is not permitted). As soon as one of the signal inputs changes its status. the OPC A&E state machine does not allow separate acknowledgement of signal edges that “came in” and “went out”. The severity (also weighting) of the alarm is set on the SEVERITY parameter with a range of values from “0” to “127” and a low number represents a high severity. the inputs of an I/O module are connected to the SIG_1 to SIG_8 signal inputs (also channels) of the block. to the DB10 data block as shown here. These values are ANY pointers that point. A positive change is assessed as an “incoming” event and a negative change as an “outgoing” event.5 Explanation of the S7 Sample Program 5. for example.0. The bit array shows “1” for acknowledged and “0” for unacknowledged. an alarm is triggered. The value included there is provided as an associated value when triggering the alarm. Note Unlike the S7 CPU. Copyright  Siemens AG 2011 All rights reserved Associated value parameters Up to 10 associated values can be parameterized. 60 Alarm Client with OPC A&E V2. Bits 0 to 7 are required for “incoming” events and bits 8 to 15 for “outgoing” events of the 8 channels. The current acknowledgement status of the individual channels is represented in the ACK_STATE parameter. The signal status can be acknowledged only once via OPC.6 Sample call of an ALARM_8P Channel parameters For example.

the triggering channel (here SIG_3) is known (see parameters of the block call). The S7 block severity is converted to OPC event severity (here: “0” becomes default = “500”). When using CD 2010 V8. associated values are extracted.6 Sample call of an ALARM_8P Response The figure below shows the response of the components when an alarm is triggered: Figure 5-8 Copyright  Siemens AG 2011 All rights reserved The following table describes the sequences between the components when an alarm is triggered. A call of the ALARM_8P block is triggered. 3 4 5 Alarm Client with OPC A&E V2.0 or later. formatted and inserted into the text. if this is the case. If not prevented by a filter criterion. the OPC server uses a binary text database instead of the scores7.3 input changes from “0” to “1”. Table 5-11 No. the scores7.5 Explanation of the S7 Sample Program 5. 1 2 Description The status of the E0. the S7 station sends an event to the connection partner (the PC station).msg file is searched to determine whether a message text is stored for “ALARM1. the notification is sent to the OPC client.msg file to map the texts to the OPC alarm. The SIMATIC NET OPC server identifies the alarm by its origin (S7 connection) and its event ID (here: “1”). Before the alarm is now signaled to the OPC clients. Furthermore. ID Number: 26548467 61 . The “ALARM1. If necessary.0.3” identifier (event ID=1 and signal=3) is assigned to the event and the OPC attributes are filled.3”. Via the S7 protocol. The S7 connection name (here: “S7:\400”) is entered as an OPC Event Source. the Time and ActiveTime parameters and the OPC Category are filled. this text is copied to the OPC Message parameter. The OPC server now checks the received parameters and maps them to an OPC Event Notification.

Introduction Note The required blocks and message texts are generated by STEP 7. the implicit acknowledgement event is no longer initiated.7 Sample configuration of system error messages SIMATIC stations offer the option to configure messages that describe system errors. The user only has to load the generated blocks to the CPU. for example. ID Number: 26548467 .5 Explanation of the S7 Sample Program 5. hardware information and insert it into texts. In the above example.0 or later. “ALARM1. The necessary blocks are generated by STEP 7. DP slaves and WinAC are supported by “Report System Error” provided that they support functions such as diagnostic interrupt. the OPC A&E server sends a message to the S7-400 CPU. Via OPC Alarm and Events. Procedure The components of the S7-300 stations. merely the signal status can be acknowledged. The required blocks and text messages are preconfigured and read out. insert/remove interrupt and channelspecific diagnostics. please refer to the STEP7 online help. “ALARM1. The status can be checked in the flag word. S7-400 stations. Note A separate acknowledgement for the “incoming” and “outgoing” edge of the signal is only possible within the S7 CPU.7 Sample configuration of system error messages 6 The event is displayed in the OPC client. this channel is provided without a signal number.5” and “ALARM1. Note The name of the alarm with “ALARM<EV_ID>. Copyright  Siemens AG 2011 All rights reserved Note For more information on the parameters of the alarm blocks.0.3”. When the alarm is acknowledged in the client. the event is implicitly acknowledged the next time it occurs. this corresponds to “came in” and “requiring acknowledgement”.<SIG#>” does not exist for the first channel (SIG_1). “ALARM1. When the alarm has “come in” (signal input to “true”) and changes to the “went out” status without being acknowledged (signal input to “false”). 5. 62 Alarm Client with OPC A&E V2.2”. The status is ACTIVE and ACK_REQUIRED. When using CD 2010 V8. The diagnostic data records according to the Profibus/Profinet modules are read using SFB52 (RDREC) and SFB54 (RALRM). The following example shows how these messages are generated. 5 out of 8 channels are connected and events can occur with the following identifiers: “ALARM1”.6”. Then also the OPC server has to be reloaded to update the text database. PROFINET IO devices.

In the “General” tab. ID Number: 26548467 63 . the target FB and the DB numbers are defined. corrections have to be made. Copyright  Siemens AG 2011 All rights reserved 2.5 Explanation of the S7 Sample Program 5. Action In HW Config. the CPU is selected first and then Options  Report System Error… Comment These steps must be repeated for each CPU for which system errors are to be reported. Please make sure that these numbers are not already used for other purposes in the program. 1. If necessary.0. Alarm Client with OPC A&E V2.7 Sample configuration of system error messages Table 5-12 No.

64 Alarm Client with OPC A&E V2. the correct message class should be assigned to each reporting component and the priority should be adjusted accordingly.7 Sample configuration of system error messages No. Principle of operation The diagnostic block generated by “Report System Error” (FB with assigned instance DB and one or several global DB(s) and one FC) evaluates the local data of the error OB and reads possible additional diagnostic information of the hardware component that causes the error. ID Number: 26548467 .g. is added to the end. the call of the generated FB. Note For a detailed description of the individual parameters. Generating After generating the blocks. Depending on the used CPU. also the OPC server has to be reloaded (e. please refer to the STEP7 online help.0. If. 3. Then the SFM block that generates the message is called in this OB (an alarm_s is triggered internally). Action In the “Messages” tab. for example.5 Explanation of the S7 Sample Program 5. If they already exist.. NetPro -> save and compile all and then download). the messages are configured. error OBs are generated 7 x (redundancy error) and 8 x (time/hardware error). Comment In this tab. a module is removed from/inserted into the rack. the code for generating messages. Copyright  Siemens AG 2011 All rights reserved 4. the associated error OB (OB8x) is called.

a project is necessary. Thus.0. This is the only way to ensure that the alarm configuration. the CPU type defines the number of alarm blocks that can be called simultaneously since this occupies system resources.5 or higher.8 General Information on the alarm configuration of the S7-300 The controllers of the SIMATIC S7-300 family support only the ALARM_S and ALARM_SQ alarm blocks and the ALARM_D and ALARM_DQ blocks. Configuration of alarm texts To configure the alarm texts with STEP7. please refer to ID Number: 841294. In addition. is generated when “saving and compiling”. 20. including the text database for the OPC server. the S7-300 supports system error messages. ID Number: 26548467 65 . Alarm Client with OPC A&E V2. 40 or 300 alarms can be pending simultaneously.8 Information on the alarm configuration of the S7-300 5. Furthermore. in which the S7-300 exists and a PC station with OPC server.5 Explanation of the S7 Sample Program 5. For an overview. depending on the CPU. An S7 connection must be established between these two components. Copyright  Siemens AG 2011 All rights reserved Note Configuring alarm texts for a unilaterally connected S7-300 using STEP7 is only possible when using STEP7 version 5. (D and DQ only when using firmware version 2. The OPC server must be reloaded each time changes are made to the alarm texts.5.0 or higher). including HotFix 3.

SIMATIC stations: Install the S7 controllers as shown in the figure in chapter 2. Copyright  Siemens AG 2011 All rights reserved 3.Net Professional is only necessary on the SIMATIC PC station if the sample code is to be changed.6 Installation and Startup 6. As an alternative. ID Number: 26548467 .0): • • Note SIMATIC NET PC products SIMATIC NCM PC/S7 SIMATIC NCM PC/S7 must only be installed if STEP 7 is not installed on the PC. For the hardware configuration. Please note the setting of subnet masks. 66 Alarm Client with OPC A&E V2. Microsoft Visual Studio .g. The SIMATIC STEP 7 V5. Action PC station: Install the CP1613 PCI plug-in card in the PC station as described in the installation instructions included in the delivery. Standard software installation For the software components.5 configuration tool is only required on the PC station if the S7 controllers are to be changed or loaded. Deviations in the hardware configuration must be considered when configuring. The descriptions and manuals as well as delivery information included in the delivery of the respective products should be observed in any case.0. Hardware installation For the hardware components..1 Hardware and software installation 6 6. 1. 2. engineering station). Connect the PC station to the two SIMATIC stations via Ethernet as shown in the figure in chapter 2. the development environment can be installed on a separate PC (e. please refer to chapter 2. Note The installation guidelines for Industrial Ethernet networks must always be observed. Note If neither STEP 7 nor SIMATIC NET is installed on the PC station. the onboard Ethernet card can also be used.1 Installation and Startup Hardware and software installation This chapter describes which hardware and software components have to be installed. please refer to chapter 2. follow the instructions listed in the table below: Table 6-1 No. install STEP 7 first. Comment Instead of the CP1613. As an alternative. this software package can also be installed on a separate computer. Starting up the example requires the following components from the SIMATIC NET CD 2010 (V8.

if necessary.6 Installation and Startup 6. The following table shows the configuration of the SIMATIC S7 station by means of download from the SIMATIC Manager. This STEP7 project can only be used without adaptation if the hardware is identical to the configuration. follow the steps listed in the table below. Note The project file provided with this example contains the fully configured SIMATIC S7 stations according to the description in chapter 2. 6.zip Double-click on the AEClient. 6.2 Application software installation The user interface and the source code of the application are supplied as a ZIP file. Table 6-2 No.2 Application software installation Note During the Visual Studio .0. install Windows updates. Optional. Copyright  Siemens AG 2011 All rights reserved Table 6-3 No. 4. 3. ID Number: 26548467 67 . After installing the development environment. Action Unzip the following file: 26548467_OPC_AE _CODE_v20. The STEP 7 project included in the delivery then has to be opened and adapted accordingly. This is particularly necessary if the hardware releases differ or if the Ethernet addresses are not identical.Net. Comment Contains the executable file and the source code. 2.3. all configuration information is overwritten. 1. After saving and compiling.exe file. please check the security of the SIMATIC PC station and. the configuration of the SIMATIC stations has to be adjusted. Alarm Client with OPC A&E V2.Net installation. 5. Starts the sample application. Action Install the SIMATIC STEP 7 software as described in the installation instructions. Comment Restart necessary.3 Configuration of the SIMATIC S7 stations All hardware and software components must have been successfully installed and cabled accordingly. To start the user interface on the SIMATIC PC station. the security settings of the Windows operating system are relaxed. If different hardware is used. Install the SIMATIC NET PC products driver software (without NCM PC). Restart necessary. Install Microsoft Visual Studio .

. Action Retrieve the project. ID Number: 26548467 . Comment Unzip the following file: 26548467_OPC_AE_STEP7_v20.3 Configuration of the SIMATIC S7 stations Table 6-4 No.0. Copyright  Siemens AG 2011 All rights reserved 4..6 Installation and Startup 6. Perform this step for the S7-300 and the S7-400 station and the PC station. Open the SIMATIC Manager by double-clicking on the icon on the desktop. Open the HWConfig tool to check the IP addresses and other hardware settings. Select Options -> Set PG/PC Interface. 2. Set the access point to the card with which you are connected to the controllers. 68 Alarm Client with OPC A&E V2. Set the S7ONLINE access point for STEP7.zip 3. 1.

select PLC --> Download. right-click on the PC station and select PLC --> Configure. 8. 5. To do so.0. Configure and download the PC station with the SIMATIC Manager. Adjust the IP address. Select the S7 station or the OPC server and start the download. After successful configuration.6 Installation and Startup 6. Confirm the dialog boxes with “Yes” to completely overwrite the station. Click on the icon in the SIMATIC Manager. This step is not necessary when importing the XDB file. Alarm Client with OPC A&E V2.3 Configuration of the SIMATIC S7 stations No. Perform this step for the S7-300 and the S7-400 station and the PC station. Open the NetPro tool to set/check the connection configuration. ID Number: 26548467 69 . Alternative: Remote configuration of the PC station with the SIMATIC Manager is also possible performing the two steps Configure and Download. Restart the modules. 9.. Action Open the Properties of the communications processor. The stations are restarted (warm restart). Perform this step for the S7-300 and the S7-400 station. Select the station to download the configuration.. Comment 6. Copyright  Siemens AG 2011 All rights reserved 7. Confirm respective dialog boxes with “Yes”.

6 Installation and Startup 6. 3. After saving and compiling. Click on Import Station. icon in the Comment Unzip the following file: 26548467_OPC_AE_STEP7_v20. This file can only be used without adjustment if the hardware is identical to the configuration. If different hardware is used.4 Commissioning of the PC station 6. The following table shows the configuration of the PC station by means of importing an XDB file. 1. Note The project file (XDB) provided with this example contains the fully configured PC station.4 Commissioning of the PC station All hardware and software components must have been successfully installed and cabled. 4. Copyright  Siemens AG 2011 All rights reserved Action Retrieve the project. This is particularly necessary if the hardware releases differ or if the Ethernet addresses are not identical. The STEP 7 project included in the delivery then has to be opened and adapted accordingly (see chapter 7). 70 Alarm Client with OPC A&E V2. The XDB file is located in the XDBs subdirectory of the unzipped ZIP file in the directory tree of the STEP7 project. all configuration information in the XDB file is overwritten. Confirm the following query with Yes. ID Number: 26548467 . Table 6-5 No. Select the XDB file.0. Open the Station Configurator by doubleclicking on the taskbar. the configuration of the PC station has to be adjusted.zip 2.

ID Number: 26548467 71 . Comment Copyright  Siemens AG 2011 All rights reserved • Alarm Client with OPC A&E V2.0. 5.6 Installation and Startup 6. • Action After importing the XDB file.4 Commissioning of the PC station No. the PC station has been configured.

72 Alarm Client with OPC A&E V2. Adjust the configuration as required for your hardware. all configuration information is overwritten. Comment The name “AE-Sample2” was used here.1 Configuration of the SIMATIC S7 stations 7 7. Copyright  Siemens AG 2011 All rights reserved 2. Note After saving and compiling. Insert SIMATIC 400 Station and assign name (here: “S7-400”). Insert SIMATIC 300 Station and assign name (here: “S7-300”). Action Start STEP 7: Open the SIMATIC Manager and create a new project. CPs and other components. 1.1 Configuration Configuration of the SIMATIC S7 stations All hardware and software components must have been successfully installed and cabled accordingly. Open SIMATIC stations with HW Config and insert CPU.0. The following configuration steps of the SIMATIC S7 stations exemplify the procedure. The following table shows the configuration of the SIMATIC S7 station. ID Number: 26548467 . Table 7-1 No.7 Configuration 7. 3.

Create an Ethernet network. the Properties dialog box opens.0.168.1 Configuration of the SIMATIC S7 stations No.52) and the associated subnet mask. A MAC address is entered only if the station is to communicate via ISO transport layer 4. Action To set the IP address.7 Configuration 7.0. Alarm Client with OPC A&E V2. Copyright  Siemens AG 2011 All rights reserved Set the IP address (here: 192. 4. Comment 5. ID Number: 26548467 73 .

The stations are restarted (warm restart). 7. Confirm respective dialog boxes with “Yes”. ID Number: 26548467 . The connection configuration is described together with the configuration of the PC station (in chapter 7.0. Action Repeat the steps for both SIMATIC stations and then download both stations. Copyright  Siemens AG 2011 All rights reserved Restart the modules. Create S7 connections. 74 Alarm Client with OPC A&E V2. 8. 6.7 Configuration 7.1 Configuration of the SIMATIC S7 stations No.2). Comment Perform this step for the S7-300 and the S7-400 station.

7 Configuration 7. The procedure is identical.0. 1. The “OPC Server” application was plugged into slot “1”. Table 7-2 No. Insert SIMATIC PC station and specify name. The slot must be identical to the index assigned in the configuration console. Copyright  Siemens AG 2011 All rights reserved 3. but unilaterally configured connections are used. Comment Open the previously created “AE-Sample” project.2 Configuration of the PC station The SIMATIC PC station is configured using STEP 7 and described step by step. 2. here index “2” for Ethernet card.2 Configuration of the PC station 7. Action Start STEP 7: Open SIMATIC Manager and project. The name of the PC station must be identical to the “Windows name” of the PC (see My Computer  Properties  Computer Name). Alternatively. Open PC Station with HW Config and insert CP. ID Number: 26548467 75 . Alarm Client with OPC A&E V2. the NCM PC software package can also be used for the configuration.

7 Configuration 7. 5.172.2 Configuration of the PC station 4.168. ID Number: 26548467 . An IP address (here: “192. 76 Alarm Client with OPC A&E V2. the use of symbolic addressing is enabled in the “S7” tab.1”) is assigned for the Ethernet card and the card is connected to the Ethernet network.0. Copyright  Siemens AG 2011 All rights reserved On the OPC Server Properties pages (double-click on OPC Server).

the Properties dialog box is displayed by doubleclicking in the list of connections. the connection name can be changed (here: “300” for the connection to the S7300 and “400” for the connection to the S7-400). The connection partners and connection parameters are displayed. The connection is configured for the transfer of “Block and Symbolrelated Messages” and “Diagnostic Messages”. 9 10 Alarm Client with OPC A&E V2. NetPro is used to create two S7 connections from the OPC server to the two controllers. “Retain the connection permanently” is set for the Connection Establishment to ensure that the connection is maintained even if there is no communication. select the second tab (OPC Connection Parameter). In the Properties dialog box of the S7 connection. 7. After the OPC server has been selected. Copyright  Siemens AG 2011 All rights reserved S7 connection via Ethernet: Once the connection path has been selected.0. Both connections are created via Ethernet.7 Configuration 7. ID Number: 26548467 77 .2 Configuration of the PC station 6. Connection-specific settings are made here. 8.

” button (see step 8). Once the connections have been created. All alarms are signaled to the OPC clients with default priority “500”.g.7 Configuration 7. If no priority can be specified at the function block.. (See step 8) The signaling concept includes several time stamps. for example. Now the stations can be downloaded. the PC station can also be downloaded with the XDB file. Use the “Message text details. Set the language (for multilingual messages) and the time stamps.. In this dialog box.. the project must be compiled with Save and Compile. ID Number: 26548467 .. select the “Alarm Messages. According to a conversion table.. As described in chapter 6. to create a specific time zone) or the PC time of the OPC server in UTC (this setting is used. you configure which time stamp is to be used for the message. To go to the configured OPC severity list. S7 CPU time plus fixed offset (e. A list of exceptions enables the user to provide individual alarms with a changed severity. if not the S7 but only the PC is time-synchronized). this “configured severity” always prevails. all alarms of the SIMATIC station are mapped to the corresponding “OPC severity”. Either S7 CPU time (should be synchronized accordingly).” button to go to the used time stamps dialog box. 11. 10.2 Configuration of the PC station 9.0. Copyright  Siemens AG 2011 All rights reserved It is usually not necessary to set the alarm priority. 78 Alarm Client with OPC A&E V2. “500” is used by default.

insert a section into the file. identified by the local ID (lcids).<lcid>. Syntax: @2X%f@ (second associated value as a floating point) Example: ALARM5. ALARM_D. Table 7-3 No.7 Configuration 7. another configuration step is required. When downloading the PC station.exe."My Text for Diagnosis" 4. ALARM_DQ.”<messagetex t>” Example: DIAGNOSIS0x4302=0. Syntax: [<S7 Connection Name>] ALARM<event_id>=<lcids>. a wildcard marked with “@” is inserted into the text and the number of the associated value is entered at the block and a formatting qualifier is entered. ALARM_SQ. NOTIFY_8P. respective texts are then assigned to the event IDs.<lcid>. For each alarm sent from the S7. for S7-300 controllers. the file is located in: c:\Program Files\Siemens\Simatic. Associated values of S7 blocks can also be output within a message text. e. switch of heater @2X%u@” Syntax: DIAGNOSIS<hex>=<lcids>.0 7.g.3=0. Version V8. Respective texts are stored in the STEP 7 configuration database for each alarm number. selected on the server. NOTIFY. If no text is stored. the alarm is only forwarded with its ID number (default behavior).3 Configuration of the OPC A&E server < V8.4 + HF2 and higher. these texts can be stored in different languages. notepad. Action Open the scores7.4 + HF2 and higher). for example. Comment In Windows XP.g. For each S7 connection.1033. Once an S7 connection for the transfer of events has been configured. ALARM_S.Net\opc2\binS7\ In each section.“My Message Text Example” 3. e. This is possible in different languages. the texts configured in STEP7 are made available to the OPC server. If useful texts are to be sent to the clients in addition to the alarm ID numbers. Blocks with associated values are. the server checks whether a text was configured and inserts this text into the OPC event in the language. ID Number: 26548467 79 . Alarm Client with OPC A&E V2. Note The configuration of message texts is available for SIMATIC NET version V6. 1.0 It is usually not necessary to configure the SIMATIC NET OPC A&E server. 2. however.0 and higher. Diagnostic alarms are signaled by S7 controllers and usually appear in the diagnostic buffer of the relevant CPU. the SIMATIC NET OPC A&E server can receive these alarms and forward them to connected clients. Extended configuration of multilingual texts via STEP7 is possible for SIMATIC NET version V8. ALARM_8P.3 Configuration of the OPC A&E server < V8.0 and higher still support this version. extended message configuration via STEP7 should be used. To do so. ALARM.”<message text>” Example: [400] ALARM2=0.0. only one associated value is possible per block.1033. the section name must correspond to the S7 connection name (here: “[400]” and “[300]”).“Boiler Temperatur of @1X%d@ degrees was exceeded.msg file with a text editor. Copyright  Siemens AG 2011 All rights reserved The following section describes the message text file (SIMATIC NET version V6.

0: The scores7. a text database is generated. Copyright  Siemens AG 2011 All rights reserved 80 Alarm Client with OPC A&E V2.msg file is no longer used in SIMATIC NET OPC A&E server version V8.msg file.msg.0 5.0. Note For SIMATIC NET OPC A&E server < V8.msg file is read out by the SIMATIC NET OPC A&E server only during startup. Please make sure that the server restarts after changes have been made to this file.0 or higher.bin). The scores7. which is then used by the OPC server (scores7. When downloading from STEP 7. Further information More information is available in the actual scores7.7 Configuration 7. ID Number: 26548467 .3 Configuration of the OPC A&E server < V8.

1 S7:\[300]MW12.1 input or the DB11. The operation described here focuses on the triggering of alarms and the default selection of associated values.DBX 0.1 S7:\[300]DB11. An ALARM_SQ is triggered when either the 0. Three items are monitored in OPC Scout (OPC Data Access client): • • • S7:\[300]DB11. Note To provide a simplified representation of the principle of operation. You are provided with information on.0. Figure 8-1 PC application Copyright  Siemens AG 2011 All rights reserved Display Acknowledgement Alarms Associated value Status Trigger Data The alarm block receives a fixed ID that is unique on a CPU-wide basis and that has been interconnected with an associated value (here an Any pointer that points to a double word in data block 11)..1 (Begleitwert [associated value]) (Status) (Trigger) Alarm Client with OPC A&E V2. a flag bit was interconnected in addition to the input. The necessary STL code fragment is executable in the S7-300 and the S7-400 and used here as a general example. an ALARM_SQ is called cyclically in OB1 via FB200. Overview To simulate an alarm.X1. ID Number: 26548467 81 .DWORD0. The return value of the alarm block is written to flag word 12.8 Operation of the Application 8 Operation of the Application how you can operate all functions of this application..0.3 data block bit changes to “1” status.

8 Operation of the Application

Triggering alarms To simulate an alarm, the 10.0 flag bit can now be used in addition to the physical E0.3 input. The flag bit is written with OPC Scout (trigger). An alarm with ID number 5 is triggered when the status changes from “0”  “1”, an additional alarm is triggered in the event of a status change from “1”  “0”. This corresponds to the “came in” and “went out” principle of status-controlled alarms.
Table 8-1 No. 1. Action Start the OPC A&E client (this example). Comment

Copyright  Siemens AG 2011 All rights reserved

2. 3.

Select the server. Connect.

In the drop-down box of the user interface, the OPC A&E server can be selected. The Connect button is used to establish the connection to the server. Once the connection has been established, two configuration dialog boxes for the subscription are displayed.

4.

Configure the subscription settings.

82

Alarm Client with OPC A&E V2.0, ID Number: 26548467

8 Operation of the Application

No. 5.

Action Configure the subscription filter settings.

Comment

6.
Copyright  Siemens AG 2011 All rights reserved

Display of active alarms.

Alarm Client with OPC A&E V2.0, ID Number: 26548467

83

8 Operation of the Application

No. 7.

Action Start the OPC Data Access client (OPC Scout).

Comment

8.
Copyright  Siemens AG 2011 All rights reserved

Browse to the symbolic representation of the address area and insert the items (variables) into the bottom DA view.

84

Alarm Client with OPC A&E V2.0, ID Number: 26548467

8 Operation of the Application

No. 9.

Action Click in the “New Value” field to display the dialog box for writing values.

Comment

10.
Copyright  Siemens AG 2011 All rights reserved

Default selection of the associated value (for example, “123”). Subsequently, trigger the alarm by writing “1” (true) to the “SignalDQAlarm” item.

11.

Display of the alarm in the sample application.

12.

To acknowledge the alarm, select the line by right-clicking on it and select the dropdown menu.

Alarm Client with OPC A&E V2.0, ID Number: 26548467

85

Copyright  Siemens AG 2011 All rights reserved Topic \1\ \2\ \3\ Reference to the document Siemens A&D Customer Support OPC Data Access Custom Interface Version 3.com/WW/view/en/13542666 Manual for industrial communication on PG/PC with SIMATIC NET.com \4\ Specification on the OPC Foundation website for download for OPC members http://www. ID Number: 26548467 .siemens. see: Start  Simatic  Documentation  English.automation.NET Framework Title http://support.siemens. Installed by SIMATIC NET.siemens.automation.siemens. ID Number: 13542666 http://support. ID Number: 2044387 http://support. Available in Product Support.0 SIMATIC NET Commissioning PC Stations – Manual and Quick Start for SIMATIC NCM PC / STEP 7 version V5. Available in Product Support.com/WW/view/en/26548467 http://support.2 or higher SIMATIC NET – Industrial Communication with PG/PC IPC Configurator .microsoft.1 Related literature Bibliography This list is by no means complete and only presents a selection of related references. Table 9-1 Topic \1\ STEP7 Title Automating with STEP7 in STL and SCL Hans Berger Publicis Corporate Publishing ISBN 3-89578-113-4 9.automation.automation.com/WW/view/en/17128155 http:\\www.2 Internet link specifications This list is by no means complete and only presents a selection of appropriate information.automation. see: Start  Simatic  Documentation  English.org \5\ Description of or information on: • General information on the PC tools.siemens.opcfoundation.com \6\ \7\ \8\ 86 Alarm Client with OPC A&E V2.com/WW/view/en/2044387 http://support.9 Related literature 9 9.0 OPC Alarm and Events Custom Interface Version 3.0. Installed by SIMATIC NET. • Functions of NCM PC.

ID Number: 26548467 87 .0 Date 10/30/07 04/29/11 First edition Features from SIMATIC NET CD 2010 added Modification Copyright  Siemens AG 2011 All rights reserved Alarm Client with OPC A&E V2.10 History 10 History Table 10-1 History Version V1.0 V2.0.