Siemens SIMATIC S5-115U User Manual page 506

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

Integral Real-Time Clock
Operand
Signal States
DB2
DW 4
KH=0003
DW 5
KH=0103
DW 6
KH=8812
DW 7
KH=0000
MW 10
KH=0014
or
MW 10
KH=0004
Example: Program for setting clock time and date.
Settings for clock time and date are transferred depending on the signal state at input 12.1. These
settings must be transferred to flag bytes 120 and 127 before setting input 12.1 (cf. OB1). Values
which are not to be changed must be preset with FF
(1=12-hour mode). Input 13.0 is the AM/PM bit for 12-hour mode.
The clock data area is in DB2 from DW 0, and the status word is FW 10.
OB1 STL
:
:
:
:
:
:A
I
12.1
:S
F
20.0
:
:JU
FB
10
NAME :UHR-STEL
LPYR :
FY 120
WDAY :
FY 121
DATE :
FY 122
MON
:
FY 123
YEAR :
FY 124
HOUR :
FY 125
AMPM :
I
13.0
MIN
:
FY 126
SEC
:
FY 127
ERR
:
F
12.1
MODE :
I
14.0
:BE
13-14
Meaning
Leap year and weekday (TUE)
Date (01) and month (03)
Year (88) and hours (12)
Minute (00) and second (00)
In "STOP" and "RUN" modes:
Bit 4=1: The clock area is updated in
STOP mode.
Bit 2=1: Transfer settings
Only in RUN mode:
Bit 4 = 0: clock data is not updated in
STOP mode.
Bit 2 = 1: Transfer settings
. Clock mode can be defined with input 14.0
H
================================
SETTING CLOCK TIME AND DATE
================================
LOAD TIME AND DATE VALUES
INTO FB 120 TO FB 127 FIRST!
CLOCK SETTING TRIGGERED
BY SETTING F 20.0 (RESET IN FB 10)
LEAP YEAR
WEEKDAY
DAY
MONTH
YEAR
HOUR
AMPM BIT (ONLY IMPORTANT IN 12-HR MODE)
MINUTES
SECONDS
ERROR BIT
12-HR MODE: I 14.0 = 1
S5-115U Manual
Description
EWA 4NEB 811 6130-02b

Advertisement

Table of Contents
loading

Table of Contents