User Program - Siemens S5-100U User Manual

Simatic s5 programmable controller
Hide thumbs Also See for S5-100U:
Table of Contents

Advertisement

S5-100U
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
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
:
:
:
:
:
:A
I
0.0
:S
F
20.0
:JU
FB
10
NAME :SET CLOCK
WDAY :
FY 121
DAY
:
FY 122
MON
:
FY 123
YEAR :
FY 124
HOUR :
FY 125
AMPM :
I
0.1
MIN
:
FY 126
SEC
:
FY 127
ERR
:
F
12.1
MODE :
I
1.0
:BE
EWA 4NEB 812 6120-02
". You can define the clock mode with input I 1.0(1= 12-
H
================================
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)
(SETTING THE TIME AND DATE)
WEEKDAY
DAY
MONTH
YEAR
HOUR
AMPM-BIT (ONLY IMPORTANT IN 12-HOUR MODE)
MINUTES
SECONDS
ERROR BIT
12-HOUR MODE: I 1.0 = 1
The Integral Real-Time Clock
Explanation
12-21

Advertisement

Table of Contents
loading

Table of Contents