×
Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 57249109, Entry date: 08/15/2019
(17)
Rate

Monitoring and Control of Network Components with a SIMATIC S7-PN CPU with the aid of SNMP

  • Entry
  • Associated product(s)
SNMP blocks for SIMATIC S7-PN CPUs for monitoring, controlling and configuration of SNMP capable network components.

SNMP is a protocol that has established itself due to its modularity and versatility as a standard for the network management. Among the central tasks of a network management are

  • monitoring of network components (network-, configuration-, status information and statistic data)
  • the control and configuration of network components.

These functions should also be made possible for SIMATIC S7 CPUs.

The diagram below shows a network where the S7 CPU controls different network components.

This application task contains a library with universal SNMP blocks and two application examples for reading and writing of SNMP variables and sending of SNMP traps.  

The library "LSnmp" includes the following core blocks:

  • "SnmpGet" block for request of a SNMP variable
  • "SnmpGetNext" block for request of a sequence of SNMP variables
  • "SnmpGetBulk" block for request of SNMP variables in blocks
  • "SnmpSet" block for writing of SNMP variables
  • "SwitchIO" block for control and request of the digital IO of a SCALANCE W

The use of the SNMP blocks is shown in in detail on two application examples.

  • Application example 1 for the reading and writing of SNMP variables.
  • Application example 2 for the sending of SNMP traps.

Documentations and Projects

  Description of SNMP library "LSnmp" (894,6 KB)
The library "LGF (Library of general functions)" contains additional functions for STEP 7 (TIA Portal).
Among a variety of functions. In this library (entry id: 109479728) is the SNMP libray available.

  Documentation for Application example 1 (841,3 KB)
 Registrierung notwendig  Project for Application example 1 (5,9 MB)

  Documentation for Application example 2 (1,3 MB)
 Registrierung notwendig  Project for Application example 2 (2,1 MB)

Note
Using a S7-300/400 PLC, the value of an OID element can be max 16383.
Using a S7-1500 PLC, please use "optimized block access".

Creation Environment
Projects and documentations were created with STEP 7 V15.1

Additional Keywords
SNMP, Traps, SINEMA Server V12, TRAP-ID, OID, SNMPv1, SCALANCE W, SCALANCE X


Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.