Programming The Integral Real-Time Clock In The User Program - Siemens SIMATIC S5-90U System Manual

Table of Contents

Advertisement

Integral Real-Time Clock
13.6

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 13.5 and
13.6). The following section provides you with information on how to access the clock through the
user program.
13.6.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 32.0. Before you set input I 32.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
12-hour mode). Input I 32.1 is the AM/PM bit that you use for setting the 12-hour mode.
The clock data area is located in DB2 beginning with DW0, and the status word is FW10.
OB1 STL
:
:
:
:
:
:U
E
32.0
:S
M
20.0
:
:SPA FB
10
NAME :UHR-STEL
WDAY :
MB 121
DAY
:
MB 122
MON
:
MB 123
YEAR :
MB 124
HOUR :
MB 125
AMPM :
E
32.1
MIN
:
MB 126
SEC
:
MB 127
ERR
:
M
12.1
MODE :
E
33.0
:BE
13-12
". You can define the clock mode with input I 33.0 (1 =
H
Explanation
================================
SETTING THE TIME AND DATE
================================
FIRST TRANSFER TIME AND DATE VALUES
INTO FB120 TO FB127.
CLOCK SETTING TRIGGERED
BY SETTING F 20.0 (RESET IN FB10)
WEEKDAY
DAY
MONTH
YEAR
HOUR
AMPM-BIT (ONLY IMPORTANT IN 12-HOUR MODE)
MINUTES
SECONDS
ERROR BIT
12 HOUR-MODE: I 33.0 = 1
S5-90U/S5-95U
EWA 4NEB 812 6115-02b

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s5-95u

Table of Contents