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!
Clock Memory
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.
Uses
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).
Possible Frequencies
Each bit of the clock memory byte is assigned a frequency. The following table shows the assignment:
Bit of the Clock Memory Byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Period Duration (s) | 2.0 | 1.6 | 1.0 | 0.8 | 0.5 | 0.4 | 0.2 | 0.1 |
Frequency (Hz) | 0.5 | 0.625 | 1 | 1.25 | 2 | 2.5 | 5 | 10 |
| Note 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. |