show the entry list
S7-1500 CPU 15xx -- Creating S7 programs -- Calling blocks and functions
How do you program and parameterize Modbus/TCP communication between S7-1500 CPUs and S7-1200 CPUs?
What should you watch out for when you migrate the AG_SEND/AG_LSEND instruction from the user program of the S7-300/S7-400 in the TIA Portal to the user program of the S7-1500?
What should you watch out for in STEP 7 (TIA Portal) when transferring FC and FB parameters for new S7-1200/S7-1500 controllers?
What is the maximum number of parameters you are allowed to define in STEP 7 (TIA Portal) for a function in the S7-1200/S7-1500 CPU?
In STEP 7 (TIA Portal) how do you configure data blocks with the "Only store in load memory" attribute?
How do you read out the IP address of the PROFINET interface of a S7-1500 CPU in the user program?
How do you configure and program an S7 connection and the PUT and GET communication instructions for data transfer between two S7-1500 CPUs?
How do you program the TCON communication instruction to establish a connection for the Open User Communication between two S7-1500 CPUs?
In STEP 7 (TIA Portal), how can you read out diagnostics data of a hardware object with the GET_DIAG instruction?
Why do changed parameters not become active?
Why is the "GET_NAME" instruction not executed in STEP 7 (TIA Portal) V12?
What differences should you watch out for between optimized data storage and the standard type of block access in STEP 7 (TIA Portal) V12?
What should you watch out for when in STEP 7 (TIA Portal) V12 you insert blocks with the same block number in your program for the S7-1500?
Why is universal definition and utilization of symbols in STEP 7 (TIA Portal) V12 obligatory for the S7-1500?
How do you declare the timers and counters for the S7-1500 in STEP 7 (TIA Portal) V12?
Why should whole structures instead of many single components be transferred for the S7-1500 when a block is called?
In STEP 7 (TIA Portal) V12, why do you have to insert a SET instruction after a jump command in order to ensure a first scan?
STEP 7 (TIA Portal) -- Creating S7 programs -- Editing date, time and counters
In STEP 7 (TIA Portal), how do you program the opening and closing of shutters at sunrise and sunset respectively for the S7-1200/S7-1500?
Time synchronization - Time synchronization in the automation environment
In STEP 7 (TIA Portal), how do you convert the number of days, hours, minutes and seconds into milliseconds?
How do you convert an available millisecond value into days, hours, minutes and seconds in STEP 7 (TIA Portal)?
How do you declare the timers and counters for the S7-1500 in STEP 7 (TIA Portal) V12?
Which functions are available in STEP 7 V5.5 and in TIA Portal for processing the data types DT and DTL?
In STEP 7 (TIA Portal) V11, how can you schedule a program event for an S7-1200?
In STEP 7 (TIA Portal), how can you input, read out and edit the date and time for the CPU modules of S7-300/S7-400/S7-1200/S7-1500?
Why is the Online status of the timer not updated in STEP 7 (TIA Portal)?
How do you implement a weekly timer for the SIMATIC S7-1200 in STEP 7 V11?
How is the runtime of a terminal device (pump, for example) calculated in STEP 7 V11?
How do you declare the timers and counters for the S7-1500 in STEP 7 (TIA Portal) V12?
Part number:

In this entry we deal with the topic of "Using times in the program" and the different ways of proceeding in STEP 7 V5.x and STEP 7 (TIA Portal) V12.

Procedure in STEP 7 V5.x
Due to their compatibility with STEP 5 you can also use STEP 7 S5 Timer and S5 Counter. These timers/counters are global and are addressed by one number. When you start the timers/counters, with the call of the "Value Range" and "Precision" modes it is defined whether the timer is to run as switch-on delay or the counter as up counter. Pay attention to the following system properties when calling and setting parameters:

  • The programs are specifically number-dependent.
  • Blocks with S5 timers/counters cannot be used multiple times.
  • The value range of the time is limited to a maximum of 9990s and that of the counter to a maximum of 999.
  • The interval times are 0.01 .. 9.99, 0.1 … 99.9, 1 … 999 and 10 … 9990 seconds.
  • The timer precision depends on the time interval selected.

Procedure in the TIA Portal
Declare the timers and the counters in the block in which they will be called and used. The IEC time is a structure of the data type IEC_TIMER, IEC_LTIMER, TON_TIME or TON_LTIME, which you can also declare as local variable in a block.


  • You can call the block multiple times with newly created instance data blocks.
  • The blocks have a wider counting range and the timer precision is independent of the interval timing.
  • The IEC timer provides a better performance than the S5 timers.

Fig. 01 shows two examples for this procedure. The IEC time "SwitchDelay" was declared as local variable of the data type "TON_TIME" and the IEC counter "CountDB" as local variable of the data type "CTU_INT".

Fig. 01

Note on security
The functions and solutions described in this article confine themselves predominantly to the realization of the automation task. Furthermore, please take into account that corresponding protective measures have to be taken in the context of Industrial Security when connecting your equipment to other parts of the plant, the enterprise network or the internet. More information is available in Entry ID: 50203404.

Creation environment
The figures in this FAQ response were created with STEP 7 V12.

 Entry ID:67585220   Date:2013-02-28 
I regard this helpfulas not helpful                                 
My Documentation Manager 
Support Request
To this entry
Create PDF 
Send to a friend
Compatibility tool 
Online Help
Guided Tour