Professional Documents
Culture Documents
Note The Application Examples are not binding and do not claim to be complete regarding the
circuits shown, equipping and any eventuality. The Application Examples do not represent
customer-specific solutions. They are only intended to provide support for typical
applications. You are responsible for ensuring that the described products are used
correctly. These Application Examples do not relieve you of the responsibility to use safe
practices in application, installation, operation and maintenance. When using these
Application Examples, you recognize that we cannot be made liable for any
damage/claims beyond the liability clause described. We reserve the right to make
changes to these Application Examples at any time without prior notice.
If there are any deviations between the recommendations provided in these Application
Examples and other Siemens publications – e.g. Catalogs – the contents of the other
documents have priority.
We do not accept any liability for the information contained in this document.
Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
deficiency or breach of a condition which goes to the root of the contract
(“wesentliche Vertragspflichten”). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
Siemens AG 2017 All rights reserved
the type of contract, except in the event of intent or gross negligence or injury to
life, body or health. The above provisions do not imply a change of the burden of
proof to your detriment.
Any form of duplication or distribution of these Application Examples or excerpts
hereof is prohibited without the expressed consent of the Siemens AG.
Security Siemens provides products and solutions with industrial security functions that support the
informa- secure operation of plants, systems, machines and networks.
tion In order to protect plants, systems, machines and networks against cyber threats, it is
necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial
security concept. Siemens’ products and solutions only form one element of such a
concept.
Customer is responsible to prevent unauthorized access to its plants, systems, machines
and networks. Systems, machines and components should only be connected to the
enterprise network or the internet if and to the extent necessary and with appropriate
security measures (e.g. use of firewalls and network segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be taken into
account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more
secure. Siemens strongly recommends to apply product updates as soon as available and
to always use the latest product versions. Use of product versions that are no longer
supported, and failure to apply latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security
RSS Feed under http://www.siemens.com/industrialsecurity.
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 2
Table of Contents
Table of Contents
Warranty and Liability ................................................................................................. 2
1 Introduction ........................................................................................................ 4
1.1 Overview............................................................................................... 4
1.2 Mode of operation ................................................................................ 4
1.3 Prerequisites ........................................................................................ 5
1.4 "Get_Alarm” basics............................................................................... 5
2 Engineering ........................................................................................................ 6
2.1 Hardware configuration ........................................................................ 6
2.2 Components used ................................................................................ 6
2.3 Programming of TIA Portal project ....................................................... 7
2.4 Configuring the OPC UA server of the S7-1500 .................................. 7
3 Operating the Application Example ................................................................. 8
3.1 Receiving pending alarms in PLC_1 using "Get_Alarm" and
sending it to PLC_2. ............................................................................. 9
3.2 Reading out of the received alarms ................................................... 12
3.2.1 Reading out of the received alarms in TIA Portal .............................. 12
3.2.2 Reading out of the received alarms via web server ........................... 13
3.2.3 Reading out of the received alarms via the OPC UA Client............... 14
3.3 Acknowledgement of the received alarm ........................................... 16
3.3.1 Acknowledgement of the received alarm in TIA Portal ...................... 16
Siemens AG 2017 All rights reserved
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 3
1 Introduction
1 Introduction (0…x)
1.1 Overview
Since the publication of TIA Portal V14 you can directly read out alarms from the
alarm server of the S7-1500 PLC using the "Get_Alarm" instruction. These alarms
can be sent to higher-level alarm system (e.g. PC, PLC).
(SGetAlarm) (rcvGetAlarm)
OPC Client
You can use the "Get_Alarm” instruction for the following PLC alarms of the
S7-1500:
Program_Alarm
System diagnostics
Standard Motion Control
Security (e.g. wrong login)
SINUMERIK
GRAPH
ProDiag
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 4
1 Introduction
1.3 Prerequisites
The following requirements must be met when using the "Get_Alarm" instruction:
TIA Portal V14
S7-1500 PLC as of firmware V2.0
Note If you do not enable the PLC property "Central alarm management in the PLC" in
the hardware configuration, only the IDs of the alarm text fields will be output
Siemens AG 2017 All rights reserved
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 5
2 Engineering
2 Engineering
2.1 Hardware configuration
The following figure shows the hardware with which it was tested.
Figure 2-1
Alarm
PROFINET IE
Alarm Alarm
Siemens AG 2017 All rights reserved
ET 200MP PN ET 200SP PN
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 6
2 Engineering
Note This STEP 7 project was created on the basis of the “program example for
Get_Alarm & Ack_Alarms" example in the online help of "STEP 7 Professional
V14 SP1".
The acknowledgement of the alarm and reading out of alarms received using
Get_Alarm via the “UaExpert” OPC UA client in this application example, are not
included in the online help.
If you do not use the included STEP 7 project but create your own project, carry out
the required configuration steps from the chapter “Program example for Get_Alarm
& Ack_Alarms".
https://support.industry.siemens.com/cs/ww/en/view/109747136/94225071243
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 7
3 Operating the Application Example
Load the prepared STEP 7 project into your controller. Proceed as follows:
1. Download the "109748168_Get_Alarm_PROJ_V10.zip" file onto your hard
drive.
The download can be found on the entry page of the application example
https://support.industry.siemens.com/cs/ww/en/view/109748168
2. Extract the zipped download file.
3. Navigate to "Get_Alarm" in the unzipped folder. The STEP 7 project is located
in this folder.
siemens.com
4. Open the STEP 7 project by double-clicking on the "Get_Alarm.ap14" file.
5. Select the “PLC_1” or “PLC_2” folder in the project tree and click the
“Download to device” button in the toolbar.
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 8
3 Operating the Application Example
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 9
3 Operating the Application Example
Figure 3-3
Note The "GetAlarm.start" tag is automatically reset after its processing in the user
program.
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 10
3 Operating the Application Example
Once you have started the "Get_Alarm" instruction, the following steps are carried
out in the background:
a. The "Get_Alarm" instruction is called in "OperateMode = 1" and then goes
to "OperateMode = 2".
b. New alarms are received with the "AlarmData" data type, saved in the
"alarmStorage" storage array and sent to PLC_2 via the "TSEND_C"
instruction.
Figure 3-5
Note The storage array for the “alarmStorage” alarms can store a maximum of 16
alarms in this project. If you want to change the storage size you have to adjust
the respective array size and the maximum value "maxPosition".
Siemens AG 2017 All rights reserved
c. The new alarm is received using the "TRCV_C" instruction in PLC_2 and
saved in "SLI_gDB_trcv_GAA" DB in the "rcvdStorage" storage array.
Figure 3-6
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 11
3 Operating the Application Example
In order to read out the received alarms in PLC_1 in the TIA Portal, proceed as
follows:
1. Select the “PLC_1” folder in the project tree and click the “Go online” button in
the toolbar.
2. Open the “alarmStorage” storage array in the “SLI_gDB_GAalarm” DB in which
the alarms are copied. The alarms can be seen in the respective array [Array
0…15] in “alarm > AlarmText”.
Figure 3-7
Siemens AG 2017 All rights reserved
In order to read out the received alarms in PLC_2 in the TIA Portal, proceed as
follows:
1. Select the “PLC_2” folder in the project tree and click the “Go online” button in
the toolbar.
2. Open the “GetAlarm” watch table and click on the “Monitor all” button.
Figure 3-8
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 12
3 Operating the Application Example
Figure 3-9
In order to read out the received alarms via the web server in PLC_1, proceed as
follows:
1. Call the IP address of the PLC_1 (in the example: 192.168.0.1) in a browser of
your choice.
2. Open the "Alarms" in the project tree.
Figure 3-10
Siemens AG 2017 All rights reserved
In order to read out the received alarms via the web server in PLC_2, proceed as
follows:
1. Call the IP address of the PLC_2 (in the example: 192.168.0.2) in a browser of
your choice.
2. Open the "GetAlarm" watch tables in the project tree.
Figure 3-11
Note For the watch table to be displayed in the web server, you have to enable it first
in the hardware configuration of the S7-1500 PLC "Web server > User
management" property.
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 13
3 Operating the Application Example
Figure 3-12
3.2.3 Reading out of the received alarms via the OPC UA Client
In order to read out the received alarms in PLC_1 via the OPC "UaExpert" UA
Client, proceed as follows:
1. Start "UaExpert" by double clicking it.
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 14
3 Operating the Application Example
3. In the dialog that follows, enter the URL of the OPC UA server of the PLC_1 (in
the example: opc.tcp://192.168.0.1) and click "OK".
If you read out the received alarms in PLC_2, perform the steps just as for PLC_1
but for PLC_2.
Enter the URL of the OPC UA servers of the PLC_2 (opc.tcp://192.168.0.2).
Navigate to "Root > Objects > PLC_2 > DataBlocksGlobal > SLI_gDB_trcv_GAA >
GetAlarm > rcvdStorage > [0..15]” in the "Address Space" of the server and drag
the “Alarmtext” tag in the "Data Access View" area using drag-and-drop.
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 15
3 Operating the Application Example
Figure 3-14
In order to acknowledge the received alarm in TIA Portal in PLC_2 and to send the
acknowledgment bit to PLC_1, proceed as follows:
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 16
3 Operating the Application Example
Figure 3-16
3. The acknowledgment bit is sent to PLC_1, the alarm is acknowledged and the
alarm is displayed as acknowledged.
Select the “PLC_1” folder in the project tree and click the “Receive alarms”
button in the toolbar in order to see the acknowledged alarms in PLC_1. The
alarms are listed in the “Diagnostics”, “Alarm display" tab.
Figure 3-18
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 17
3 Operating the Application Example
In order to acknowledge the received alarm via the OPC "UaExpert" UA Client and
to send acknowledgment bit to PLC_1, proceed as follows:
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 18
4 Annex
4 Annex
4.1 Service and support
Industry Online Support
Do you have any questions or need support?
Siemens Industry Online Support offers access to our entire service and support
know-how as well as to our services.
Siemens Industry Online Support is the central address for information on our
products, solutions and services.
Product information, manuals, downloads, FAQs and application examples – all
information is accessible with just a few mouse clicks at
https://support.industry.siemens.com
Technical Support
Siemens Industry's Technical Support offers quick and competent support
regarding all technical queries with numerous tailor-made offers
– from basic support right up to individual support contracts.
Please address your requests to the Technical Support via the web form:
www.siemens.en/industry/supportrequest
Service offer
Siemens AG 2017 All rights reserved
Our service offer comprises, among other things, the following services:
Product Training
Plant Data Services
Spare Parts Services
Repair Services
On Site and Maintenance Services
Retrofit and Modernization Services
Service Programs and Agreements
Detailed information on our service offer is available in the Service Catalog:
https://support.industry.siemens.com/cs/sc
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 19
4 Annex
Get_Alarm
Entry ID: 109748168, V1.0, 09/2017 20