EasyManua.ls Logo

Siemens S5-100U - User Program

Siemens S5-100U
512 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...
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-02
12-21

Table of Contents

Related product manuals