Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 64396156, Entry date: 08/15/2019

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

  • Entry
  • Associated product(s)
This entry deals with the "DataLog" process data acquisition and alarm generation 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.
  • Automatic retrieval of the logged data from a local PC station at specified times and archiving.
  • If a maximum temperature is exceeded, a message will be sent to a maintenance technician who will then identify the cause of the problem.

For the SIMATIC S7-1200, the STEP 7 (TIA Portal) development environment provides the "Data log" instructions.
These instructions allow you to store process data in the flash memory (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 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.
The CSV files are automatically archived via the API (ApplicationProgrammingInterface) of the SIMATIC Automation Tool V3.
With the "TMAIL_C" instruction, emails can be sent using an existing account with an SMTP (SimpleMailTransferProtocol) server email service provider. This function is used to implement the alarm message.

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) (1,8 MB)
 Registrierung notwendig  Executable file for automatic DataLog upload via the API of the SIMATIC Automation Tool V3.1 SP2 (incl. C# source code) (5,5 KB)
SHA-256 Checksum: D1CFE759EE3945D78A8746ED7487BC51D464A7CAA663998C43B63F320A93A6B9

Further Information
"S7-1200 Programmable Controller" System Manual
"STEP 7 Basic/Professional V15.1" System Manual
How do you parameterize the "TMAIL_C" instruction to send e-mails with the SIMATIC S7-1200?
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)
IP-based Remote Networks
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 of the executable file for automatic DataLog upload via the API of the SIMATIC Automation Tool V3.1 SP2 or higher
Update TIA Portal V15.1