Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 51929235, Entry date: 01/31/2018

Sending SYSLOG messages with a SIMATIC S7 CPU

  • Entry
  • Associated product(s)
Syslog is a simple binary UDP/IP protocol.It allows applications to send alerts, warnings or error states to a syslog server.

Syslog is used typically in computer system management and security monitoring and has now become established as a standard in the field of logging.

Applicative implementation
The "LSyslog" library provides a solution for implementing the syslog protocol in a SIMATIC S7 controller. In addition to the library, an application example is provided that shows you how to generate syslog messages in your system and send to the syslog server.

"LSyslog" library
The library provides a function block (FB) that fulfills the following functions:

  • Establishment of a UDP connection to the syslog server by means of open communication blocks.
  • Embedding of the user alarm with timestamp in the syslog protocol.
  • Sending the syslog alarm. 

Image 1

The "LSyslog" library can be used with all PROFINET-capable S7 CPUs and via Ethernet CPs/CMs with which Open User Communication (OUC) can be programmed.
These can be PLCs of the following series:

  • S7-1200 PLCs from FW 4.0
  • S7-1500 PLCs
  • S7-300 PLCs from FW 3.2
  • S7-400 PLCs from FW 6.0
  • ET 200SP PLC
  • ET 200SP Open Controllers

Application example
In this application example, security messages are read out with the instructions "Get_Alarm" and "GetChecksum" and sent to the syslog server using the "LSyslog" library. This allows you to track and document access to your controls.

The application example can be used with S7-1500 PLCs from firmware V2.0.

Documentation, library and sample project
  Documentation for library (952,0 KB)
 Registrierung notwendig  Library for STEP 7 (TIA Portal) V15.1 (863,6 KB)

  Documentation for application example (1,2 MB)
 Registrierung notwendig  Application example for STEP 7 (TIA Portal) V15.1 (3,0 MB)

Further information
Reading out Alarms in S7-1500 CPU using the "Get_Alarm" instruction and sending them to an Alarm System 

Last change 

Update for STEP 7 (TIA Portal) V15.1

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
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.