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
Содержание SIMATIC S5-100U
Страница 6: ...EWA 4NEB 812 6120 02b ...
Страница 16: ...EWA 4NEB 812 6120 02b ...
Страница 21: ...1 The SIMATIC S5 System Family EWA 4NEB 812 6120 02b ...
Страница 22: ...Figures 1 1 Members of the SIMATIC S5 System Family 1 1 EWA 4NEB 812 6120 02b ...
Страница 23: ......
Страница 27: ......
Страница 36: ...EWA 4NEB 812 6120 02b ...
Страница 40: ......
Страница 41: ......
Страница 42: ......
Страница 43: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 102: ...EWA 4NEB 812 6120 02b ...
Страница 156: ...EWA 4NEB 812 6120 02b ...
Страница 232: ...EWA 4NEB 812 6120 02b ...
Страница 268: ...EWA 4NEB 812 6120 02b ...
Страница 272: ...EWA 4NEB 812 6120 02b ...
Страница 336: ...EWA 4NEB 812 6120 02b ...
Страница 352: ...EWA 4NEB 812 6120 02b ...
Страница 412: ...EWA 4NEB 812 6120 02b ...
Страница 482: ...EWA 4NEB 812 6120 02b ...
Страница 484: ...EWA 4NEB 812 6120 02b ...
Страница 505: ...B Dimension Drawings EWA 4NEB 812 6120 02b ...
Страница 515: ...C Active and Passive Faults in Automation Equipment EWA 4NEB 812 6120 02b ...
Страница 516: ...EWA 4NEB 812 6120 02b ...
Страница 522: ...EWA 4NEB 812 6120 02b ...
Страница 523: ...D Information for Ordering Accessories EWA 4NEB 812 6120 02b ...
Страница 524: ...EWA 4NEB 812 6120 02b ...
Страница 530: ...EWA 4NEB 812 6120 02b ...
Страница 531: ...E Reference Materials EWA 4NEB 812 6120 02b ...
Страница 532: ...EWA 4NEB 812 6120 02b ...
Страница 534: ...EWA 4NEB 812 6120 02b ...
Страница 535: ...F Siemens Addresses Worldwide EWA 4NEB 812 6120 02b ...
Страница 536: ...EWA 4NEB 812 6120 02b ...
Страница 542: ...EWA 4NEB 812 6120 02b ...
Страница 543: ...Index EWA 4NEB 812 6120 02b ...
Страница 544: ...EWA 4NEB 812 6120 02b ...
Страница 550: ...EWA 4NEB 812 6120 02b ...