S5-100U
The Integral Real-Time Clock
12.7
Programming the Integral Real-Time Clock in the User Program
The programming of the clock in the user program should be performed only by users with extensive
knowledge of the system. For all other users, use of DB1 is recommended (see sections 12.2
and 12.3).
The following section provides you with information on how to access the clock through the user
program.
12.7.1 Reading and Setting the Clock
Example:
Program for setting the time and date
Transfer of the settings for the time and date is triggered by input I 0.0. Before you set input I 0.0
(see OB1), you must transfer these settings to flag bytes FY120 to FY127. Values that you do not
want to change must be preset with “FF
H
”. You can define the clock mode with input I 1.0(1= 12-
hour mode). Input I 0.1 is the AM/PM bit that you use for setting the 12-hour mode.
The clock data area is in DB2 beginning with DW0, and the status word is FW10.
OB1 STL
Explanation
: ================================
: SETTING THE TIME AND DATE
: ================================
: FIRST TRANSFER TIME AND DATE VALUES
: INTO FB120 TO FB127.
:A I 0.0 CLOCK SETTING TRIGGERED
:S F 20.0 BY SETTING F 20.0 (RESET IN FB10)
:JU FB 10
NAME :SET CLOCK (SETTING THE TIME AND DATE)
WDAY : FY 121 WEEKDAY
DAY : FY 122 DAY
MON : FY 123 MONTH
YEAR : FY 124 YEAR
HOUR : FY 125 HOUR
AMPM : I 0.1 AMPM-BIT (ONLY IMPORTANT IN 12-HOUR MODE)
MIN : FY 126 MINUTES
SEC : FY 127 SECONDS
ERR : F 12.1 ERROR BIT
MODE : I 1.0 12-HOUR MODE: I 1.0 = 1
:BE
EWA 4NEB 812 6120-02b
12-21
Summary of Contents for SIMATIC S5-100U
Page 6: ...EWA 4NEB 812 6120 02b ...
Page 16: ...EWA 4NEB 812 6120 02b ...
Page 21: ...1 The SIMATIC S5 System Family EWA 4NEB 812 6120 02b ...
Page 22: ...Figures 1 1 Members of the SIMATIC S5 System Family 1 1 EWA 4NEB 812 6120 02b ...
Page 23: ......
Page 27: ......
Page 36: ...EWA 4NEB 812 6120 02b ...
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 102: ...EWA 4NEB 812 6120 02b ...
Page 156: ...EWA 4NEB 812 6120 02b ...
Page 232: ...EWA 4NEB 812 6120 02b ...
Page 268: ...EWA 4NEB 812 6120 02b ...
Page 272: ...EWA 4NEB 812 6120 02b ...
Page 336: ...EWA 4NEB 812 6120 02b ...
Page 352: ...EWA 4NEB 812 6120 02b ...
Page 412: ...EWA 4NEB 812 6120 02b ...
Page 482: ...EWA 4NEB 812 6120 02b ...
Page 484: ...EWA 4NEB 812 6120 02b ...
Page 505: ...B Dimension Drawings EWA 4NEB 812 6120 02b ...
Page 515: ...C Active and Passive Faults in Automation Equipment EWA 4NEB 812 6120 02b ...
Page 516: ...EWA 4NEB 812 6120 02b ...
Page 522: ...EWA 4NEB 812 6120 02b ...
Page 523: ...D Information for Ordering Accessories EWA 4NEB 812 6120 02b ...
Page 524: ...EWA 4NEB 812 6120 02b ...
Page 530: ...EWA 4NEB 812 6120 02b ...
Page 531: ...E Reference Materials EWA 4NEB 812 6120 02b ...
Page 532: ...EWA 4NEB 812 6120 02b ...
Page 534: ...EWA 4NEB 812 6120 02b ...
Page 535: ...F Siemens Addresses Worldwide EWA 4NEB 812 6120 02b ...
Page 536: ...EWA 4NEB 812 6120 02b ...
Page 542: ...EWA 4NEB 812 6120 02b ...
Page 543: ...Index EWA 4NEB 812 6120 02b ...
Page 544: ...EWA 4NEB 812 6120 02b ...
Page 550: ...EWA 4NEB 812 6120 02b ...