Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 64396156, Entry date: 06/25/2020

Process Data Acquisition and Monitoring with the SIMATIC S7-1200 / S7-1500 (Data Logging)

  • Entry
  • Associated product(s)
This entry deals with the "DataLog" process data acquisition and alarm generation/data log sending via email with remote access to the CPU.

Supermarkets and discounters must ensure the cooling of certain foods. If the cold chain is broken, the foods can no longer be sold and must be disposed of. For this reason, the cooling temperature is to be continuously recorded, archived and monitored (including a signaling function).

The automation task is to include the following requirements:

  • Remote access to the data log.
  • Program changes via remote maintenance, if required.
  • If a maximum temperature is exceeded, a message will be sent to a maintenance technician who will then identify the cause of the problem.
  • The logged data should be submitted in intervals automatically to a control center and be archived.


The STEP 7 (TIA Portal) development environment provides for the SIMATIC S7-1200 / S7-1500 the "Data log" instructions.
These instructions allow you to store process data in the flash memory (S7-1200 CPU or memory card) in CSV format (comma-separated values).
This contributes to reducing the CPU's load memory pressure.
The integrated PLC Web server allows you to conveniently access these files and analyze them, for example, in Microsoft Excel.
The SIMATIC S7-1200 / S7-1500 has routing capability, which enables remote access via the Internet.
For secure communication, the connection via a VPN tunnel (VirtualPrivateNetwork) with the appropriate hardware is a suitable solution.
With the "TMAIL_C" instruction, emails can be sent via secure communication using an existing account with an SMTP (SimpleMailTransferProtocol) server email service provider. This function is used to implement the alarm message as well as the sending of the data log as attachment.
The CSV files can also be archived automatically via the API (ApplicationProgrammingInterface) of the SIMATIC Automation Tool V3.

Current version 4.0 for STEP 7 V16 (TIA Portal), S7-1200 CPU FW V4.4, S7-1500 CPU FW V2.8 and TMAIL_C V6.0
  Documentation V4.0 (2,9 MB)
 Registrierung notwendig  Project for STEP 7 V16 (TIA Portal) (4,3 MB)
 Registrierung notwendig  Executable file (V1.4) for automatic DataLog upload via the API of the SIMATIC Automation Tool V3.1 SP4 (incl. C# source code) (6,2 KB)
SHA-256 Checksum: 846619E9F1C844E4A9A6E7B8C1551815E15A627432A231BC13CF5E8CA7374EA0

Current version 3.0 for STEP 7 V15.1 (TIA Portal), S7-1200 CPU FW V4.2 and TMAIL_C V4.0
  Documentation V3.0 (3,2 MB)
 Registrierung notwendig  Project for STEP 7 V15.1 (TIA Portal) (766,5 KB)
 Registrierung notwendig  Executable file for automatic DataLog upload via the API of the SIMATIC Automation Tool V3.1 SP3 (incl. C# source code) (6,2 KB)
SHA-256 Checksum: 6766DEE79B13FAB7C9A64D9AA73C22D355C8797652CDAA8961869686833A2D58

Further Information
"S7-1200 Programmable Controller" System Manual
"SIMATIC STEP 7 Basic/Professional V16" System Manual
Sending Emails to SMTP Servers with an S7 CPU
Signaling and Switching via SMS with S7-1200 and CP 1242-7 GPRS V2 (Set 32)
Overview: Secure Remote Access with VPN
VPN Tunnel between the TS Adapter IE Advanced and Windows 7
Download: SIMATIC Automation Tool - the commissioning and service operation tool for SIMATIC modules
Application example: Automated loading and archiving of the CPU service data by means of the SIMATIC Automation Tool via the Application Programming Interface (API)

Last Changes
Update to STEP 7 V16 and S7-1500: Email sending with attachment via secure communication and UploadDataLog via router for SIMATIC Automation Tool V3.1.4

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.