EasyManua.ls Logo

Siemens SIMATIC S7 - Clock; Read and Set Real-Time Clock

Siemens SIMATIC S7
866 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Program instructions
7.2 Clock
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
185
7.2
Clock
7.2.1
Read and set real-time clock
LAD / FBD
STL
Description
TODR T
The Read real-time clock instruction reads the current time and date from the CPU
and loads it in an 8 byte Time buffer starting at byte address T.
TODW T
The Set real-time clock instruction writes a new time and date to the CPU using the
8 byte Time buffer data that is assigned by T.
Non-fatal errors with ENO = 0
SM bits affected
0006H Indirect address
0007H T data error
None
Input
Data type
Operand
T
BYTE
IB, QB, VB, MB, SMB, SB, LB, *VD, *LD, *AC
Note
READ_RTC, SET_RTC programming tips
These instructions do not accept Invalid dates. If you enter February 30, for example, a time
-
of
-day non-fatal error occurs (0007H).
Do not use the READ_RTC / SET_RTC i
nstructions in both the main program and in an
interrupt routine. A READ_RTC / SET_RTC instruction in an interrupt routine cannot execute
while another READ_RTC / SET_RTC instruction is executing. In this case, the CPU sets
system flag bit SM4.3, indicatin
g that two simultaneous accesses to the clock were
attempted resulting in a T data error (non
-fatal error 0007H).
The time
-of-day clock in the CPU uses only the least significant two digits for the year, so 00
represents the year 2000. User programs that u
se the year's value must take into account
the two
-digit representation.
The CPU handles leap year correctly through year 2099.

Table of Contents

Other manuals for Siemens SIMATIC S7

Related product manuals