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.
Explanation
OB1 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-02b
12-23
Summary of Contents for SIMATIC S5-100U
Page 6: ...EWA 4NEB 812 6120 02b ...
Page 16: ...EWA 4NEB 812 6120 02b ...
Page 21: ...1 The SIMATIC S5 System Family EWA 4NEB 812 6120 02b ...
Page 22: ...Figures 1 1 Members of the SIMATIC S5 System Family 1 1 EWA 4NEB 812 6120 02b ...
Page 23: ......
Page 27: ......
Page 36: ...EWA 4NEB 812 6120 02b ...
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 102: ...EWA 4NEB 812 6120 02b ...
Page 156: ...EWA 4NEB 812 6120 02b ...
Page 232: ...EWA 4NEB 812 6120 02b ...
Page 268: ...EWA 4NEB 812 6120 02b ...
Page 272: ...EWA 4NEB 812 6120 02b ...
Page 336: ...EWA 4NEB 812 6120 02b ...
Page 352: ...EWA 4NEB 812 6120 02b ...
Page 412: ...EWA 4NEB 812 6120 02b ...
Page 482: ...EWA 4NEB 812 6120 02b ...
Page 484: ...EWA 4NEB 812 6120 02b ...
Page 505: ...B Dimension Drawings EWA 4NEB 812 6120 02b ...
Page 515: ...C Active and Passive Faults in Automation Equipment EWA 4NEB 812 6120 02b ...
Page 516: ...EWA 4NEB 812 6120 02b ...
Page 522: ...EWA 4NEB 812 6120 02b ...
Page 523: ...D Information for Ordering Accessories EWA 4NEB 812 6120 02b ...
Page 524: ...EWA 4NEB 812 6120 02b ...
Page 530: ...EWA 4NEB 812 6120 02b ...
Page 531: ...E Reference Materials EWA 4NEB 812 6120 02b ...
Page 532: ...EWA 4NEB 812 6120 02b ...
Page 534: ...EWA 4NEB 812 6120 02b ...
Page 535: ...F Siemens Addresses Worldwide EWA 4NEB 812 6120 02b ...
Page 536: ...EWA 4NEB 812 6120 02b ...
Page 542: ...EWA 4NEB 812 6120 02b ...
Page 543: ...Index EWA 4NEB 812 6120 02b ...
Page 544: ...EWA 4NEB 812 6120 02b ...
Page 550: ...EWA 4NEB 812 6120 02b ...