Siemens S7-200plc time setting and reading network 1 Note: Set the current time to PLC, VB100: Year VB101: Month VB102: Day VB103: Time VB104: Minute VB105: Second VB106: Retain VB107: Week
LD M0.0
MOVB 16#07, VB100
MOVB 16#09, VB101
MOVB 16#115, VB102
MOVB 16#09, VB103
MOVB 16#30, VB104
MOVB 16#0, VB105
MOVB 16#0, VB106
MOVB 16#04, VB107
Network 2 Note: The time set in the previous step is written to the PLC clock by a rising edge of M0.0.
LD M0.0
EU
TODW VB100
Network 3 Note: After setting the time, read the time in the PLC in real time.
LD SM0.0
TODR VB110
Network 4 Note: Convert the read results from the BCD code format to the integer format. VW200-VW214
LD SM0.0
LPS
BTI VB110, VW200
AENO
BCDI VW200
LRD
BTI VB111, VW202
AENO
BCDI VW202
LRD
BTI VB112, VW204
AENO
BCDI VW204
LRD
BTI VB113, VW206
AENO
BCDI VW206
LRD
BTI VB114, VW208
AENO
BCDI VW208
LRD
BTI VB115, VW210
AENO
BCDI VW210
LRD
BTI VB116, VW212
AENO
BCDI VW212
LPP
BTI VB117, VW214
AENO
BCDI VW214
SHENZHEN CHONDEKUAI TECHNOLOGY CO.LTD , https://www.szfourinone.com