4-4
SIMATIC TD 200 Operator Interface
C79000-G7076-C272-01
The program displayed in Figure 4-3 generates the clock when you download all of
the blocks to the CPU and put the CPU in RUN mode.
NETWORK 1
LD SM0.0 // on every scan
TODR VB100 // ...get the clock data
HTA VB101, VB20, 2 // ...convert the month
HTA VB102, VB23, 2 // ...convert the day
HTA VB100, VB26, 2 // ...convert the year
HTA VB103, VB32, 2 // ...convert the hour
HTA VB104, VB35, 2 // ...convert the minute
HTA VB105, VB38, 2 // ...convert the second
MOVB 16#80, VB12 // ...enable the message
Network 1
Ladder Logic Statement List
T
VB100
READ-RTC
EN
SM0.0
INVB101
HTA
EN
LEN2 OUT
VB20
INVB102
HTA
EN
LEN2 OUT
VB23
INVB100
HTA
EN
LEN2 OUT
VB26
INVB103
HTA
EN
LEN2 OUT
VB32
INVB104
HTA
EN
LEN2 OUT
VB35
INVB105
HTA
EN
LEN2 OUT
VB38
IN
16#80
MOV_B
EN
OUT VB12
Figure 4-3 Sample Program for Creating a Clock
Creatin
Sample Pro
rams