Just found out how to do it.
Using the Clock Memory byte. They are activated in Properties of CPU in HW Config under the "Cycle/Clock Memory" tab. Put the Memory byte that you want to use and Voila!
The clock memory is a memory byte that changes its binary state periodically at a pulsepause ratio of 1:1. You select which memory byte is used on the CPU when you assign parameters for the clock memory using STEP 7.
You can use clock memory bytes in the user program, for example, to activate flashing lights or to trigger periodic activities (for example, measuring an actual value).
Each bit of the clock memory byte is assigned a frequency. The following table shows the assignment:
Bit of the Clock Memory Byte
Period Duration (s)
Clock memory bytes are not synchronous with the CPU cycle, in other words, in long cycles, the state of the clock memory byte may change several times.