Download TD 200 Operator Interface - Internet

Transcript
Creating Sample Programs
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.
Ladder Logic
Statement List
Network 1
SM0.0
NETWORK 1
LD
SM0.0
TODR VB100
HTA VB101,
HTA VB102,
HTA VB100,
HTA VB103,
HTA VB104,
HTA VB105,
READ-RTC
EN
VB100
T
HTA
EN
VB101
2
IN
LEN OUT
VB20
VB20,
VB23,
VB26,
VB32,
VB35,
VB38,
2
2
2
2
2
2
// on every scan
// ...get the clock data
// ...convert the month
// ...convert the day
// ...convert the year
// ...convert the hour
// ...convert the minute
// ...enable the message
NETWORK 2
MEND
HTA
EN
VB102
2
IN
LEN OUT
VB23
HTA
EN
VB100
2
IN
LEN OUT
VB26
HTA
EN
VB103
2
IN
LEN OUT
VB32
HTA
EN
VB104
2
IN
LEN OUT
VB35
HTA
EN
VB105
2
IN
LEN
OUT
VB38
MOV_B
EN
16#80
IN
OUT
VB12
Network 2
END
Figure 4-3
4-4
Sample Program for Creating a Clock
SIMATIC TD 200 Operator Interface
C79000-G7076-C205-05