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 Load start address of the DB list
: in BR
:LRW +11 Load start address of DB 11 in memory
: (paragraph address) in ACCU 1
:L KB 0
:!=F Check that OB 11 is loaded
:JC =NIVO Jump to error handling
: if DB start address = 0
:TAK
:SLD 4 Absolute address of DB 11 (DW 0)
:MAB Load contents of ACCU 1 into BR register
:L KB 2 Load function no. ’2’ in ACCU-1-L
:JU OB 121 Read system time
:BEU
:
NIVO : Error handling
:
:BE
Data block DB 11 contains the following information after OB 121 is called
(example):
0: KH = 2994; 29 sec., 940 millisec.
1: KH = 9555; 24 hour format, 15 hours, 55 minutes
2: KH = 1010; 10 days, weekday ’1’(Tuesday), 0
3: KH = 9308; 93 years, 8 months
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).
OB 121: Set/Read System Time
CPU 948 Programming Guide
C79000-G8576-C848-04
6 - 11