Specifications

4 Hardware-Independent Programming
4.3 Programming of "clock bits"
Programming Guideline for S7-1200/1500
V1.2, Entry ID: 81318674
71
Copyright
Siemens AG 2014 All rights reserved
4.3 Programming of "clock bits"
Recommendation
For the programming of clock memory bits, the hardware configuration always has
to be correct.
Use a programmed block as clock generator. Below, you can find a programming
example for a clock generator in the SCL programming language.
Example
The programmed block has the following functions. A desired frequency is
specified. The “Q” output is a Boolean value that toggles in the desired frequency.
The “Countdown” output outputs the remaining time of the current state of “Q”.
If the desired frequency is smaller or equal 0.0, then the output Q = FALSE and
Countdown = 0.0.
Period: 2 seconds
FB
Frequency [Real]
Q [Bool]
Countdown [Time]
0.5
T#0S_703MS
TRUE
Note
The complete programming example is available for free download in the
following entry:
http://support.automation.siemens.com/WW/view/en/87507915