EasyManua.ls Logo

Siemens S5-100U - Page 317

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
FB10 STL (continued) Explanation
:AN F 11.2 HAVE SETTINGS BEEN TRANSFERRED?
:JC =M002 IF YES, JUMP TO M002
:S =ERR SET ERROR BIT IF THERE ARE ERRORS
:BEU
M002 :AN F 11.0 WERE THERE ERRORS WHILE ENTERING SETTINGS?
:RB =ERR IF NO, RESET ERROR BIT
:BEC IF NO ERROR, THEN BEC
:S =ERR IF AN ERROR, SET ERROR BIT
:BE
Example: Program for reading the current time and the current date
The time is stored in flag bytes FY30 to FY36, depending on an external event, simulated here by a
positive edge at input I 0.5. Flag F 13.1 indicates which mode the clock is operating in. Flag F 13.0
is the AM/PM bit in the 12-hour mode
The clock data area is in DB2 beginning with DW0, and the status word is FW10.
ExplanationOB1 STL
: ================================
: READING TIME AND DATE
: ================================
:A I 0.5 TIME AND DATE ARE
:AN F 0.1 STORED IN FY30 TO FY36 IN CASE OF A
:= F 0.0 POSITIVE EDGE AT I 32.5.
:A I 32.5 (EXTERNAL EVENT)
:= F 0.1
:
:A F 0.0 EDGE TRIGGER FLAG
:JC FB 13
NAME :READ CLOCK (READING TIME AND DATE)
WDAY : FY 30 WEEKDAY
DAY : FY 31 DAY
MON : FY 32 MONTH
YEAR : FY 33 YEAR
HOUR : FY 34 HOUR
AMPM : F 13.0 F 13.0 = 1, AFTERNOON IN 12H-MODE
MIN : FY 35 MINUTES
SEC : FY 36 SECONDS
MODE : F 13.1 F 13.1 = 1, IN 12-HOUR MODE
:BE
EWA 4NEB 812 6120-02
12-23

Table of Contents

Related product manuals