Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 78788733, Entry date: 08/04/2014

How can timer switches be programmed in a S7-1200 in the DTL time format?

  • Entry
  • Associated product(s)
The programmed timer switch uses the DTL format.

Precise switching is a typical requirement in many industrial applications. There are different types of "timer switches" and related functions:

  • Absolute timer switches that switch at predefined times.
  • Relative timer switches that switch a predefined period and are triggered by an event.
  • Addition of times in order to form variable times.

Additional functions are:

  • the automatic summer time/winter time changeover
  • the connection of a radio clock module with DCF77 signal

Since the introduction of the TIA_Portals V11 there is the "DTL" time format which includes time details from years to nanoseconds in one format. It is the aim of this entry to provide function blocks where all time details are in the "DTL" format.

This application includes an example program which includes a function block for each mentioned function. All function blocks are based on instructions from the TIA Portal. The appropriate documentation includes a description of the program structure. The supply of the time interfaces of the function blocks can be performed via included global data blocks of via tags in the "DTL" format.

This application offers you the following advantages:

  • Expansion of the functionality of the system instructions by function blocks for which all time interfaces are programmed in the "DTL" format.
  • Tested functions blocks which save you time-consuming programming of timer switches and manages functions in the "DTL" format.
  • Simple programming and configuration with few interfaces.
  • The function blocks can be called as often as the user requires it.

Creation Environment
The code for this application has been created with STEP 7 (TIA Portal) V12

   Documentation_s7-1200_dtl_timer.pdf (641,0 KB)
 Registrierung notwendig  Code_s7-1200_dtl_timer.zip (1,5 MB)

Further Information
Library of general functions for STEP 7 (TIA Portal) (contains another timer switch)
Timer switches on the basis of S7-300/400 CPUs, optional radio clock connection
Download for function modules for SIPLUS Radio clock module DCF77

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.