Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 57249109, Entry date: 09/10/2019

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 the SNMP library (1,0 MB)
 Registrierung notwendig  Block library (1,9 MB)

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

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

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

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
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit