Siemens CPU 948 Programming Manual page 249

Simatic s5 s5-155u
Table of Contents

Advertisement

Programming example for "read system time"
FB 14 is programmed for the "read system time" function. The current values
should be stored in data block DB 11 (data word DW 0 to DW 3).
STEP 5 program:
FB14
NAME
:CLKRD
:MBR EEC00
:
:LRW +11
:
:L
KB
:!=F
:JC
=NIVO
:
:TAK
:SLD 4
:MAB
:L
KB 2
:JU
OB 121
:BEU
:
NIVO
:
:
:BE
Data block DB 11 contains the following information after OB 121 is called
(example):
0: KH = 2994;
1: KH = 9555;
2: KH = 1010;
3: KH = 9308;
4:
It is Tuesday the 10th of August 1993, 15 hours, 57 minutes, 29 seconds and
940 milliseconds (9 tenths and 4 hundredths of a second).
CPU 948 Programming Guide
C79000-G8576-C848-04
Load start address of the DB list
in BR
Load start address of DB 11 in memory
(paragraph address) in ACCU 1
0
Check that OB 11 is loaded
Jump to error handling
if DB start address = 0
Absolute address of DB 11 (DW 0)
Load contents of ACCU 1 into BR register
Load function no. '2' in ACCU-1-L
Read system time
Error handling
29 sec., 940 millisec.
24 hour format, 15 hours, 55 minutes
10 days, weekday '1'(Tuesday), 0
93 years, 8 months
OB 121: Set/Read System Time
6 - 11

Advertisement

Table of Contents
loading

Table of Contents