Siemens Simatic S7-200 System Manual page 237

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Read Real-Time Clock, Set Real-Time Clock
L
READ_RTC
A
EN
D
T
SET_RTC
EN
T
S
TODR T
T
L
TODW T
212
214
The time-of-day clock in the S7-200 uses only the least significant two digits for the year, so
for the year 2000, the year will be represented as 00 (it will go from 99 to 00).
You must code all date and time values in BCD format (for example, 16#97 for the year
1997). Use the following data formats:
Year/Month
Day/Hour
Minute/Second
Day of week
Note
The S7-200 CPU does not perform a check to verify that the day of week is correct based
upon the date. Invalid dates, such as February 30, may be accepted. You should ensure
that the date you enter is correct.
Do not use the TODR/TODW instruction in both the main program and in an interrupt
routine. A TODR/TODW instruction in an interrupt routine which attempts to execute while
another TODR/TODW instruction is in process will not be executed. SM4.3 is set indicating
that two simultaneous accesses to the clock were attempted.
The S7-200 PLC does not use the year information in any way and will not be affected by
the century rollover (year 2000). However, user programs that use arithmetic or compares
with the year's value must take into account the two-digit representation and the change in
century.
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
The Read Real-Time Clock instruction reads the current time
and date from the clock and loads it in an 8-byte buffer (starting
at address T).
The Set Real-Time Clock instruction writes the current time and
date loaded in an 8-byte buffer (starting at address T) to the
clock.
In STL, the Read_RTC and Set_RTC instructions are
represented as Time of Day Read (TODR) and Time of Day
Write (TODW).
Operands:
The time-of-day clock initializes the following date and time after
extended power outages or memory has been lost:
215
216
Date:
Time:
Day of Week
yymm
yy -
0 to 99
ddhh
dd -
1 to 31
mmss
mm - 0 to 59
000d
d -
0 to 7
T:
VB, IB, QB, MB, SMB, *VD, *AC, SB
01-Jan-90
00:00:00
Sunday
mm - 1 to 12
hh -
0 to 23
ss -
0 to 59
1 =
Sunday
0 =
disables day of week (remains 0)
Instruction Set
10-49

Advertisement

Table of Contents
loading

Table of Contents