OB 121: Set/Read System Time
Examples
Programming example for "set system time"
FB 13 is programmed for the "set system time" function. The new values are
transferred in data block DB 10 (data word DW 0 to DW 3).
STEP 5 program:
FB13
NAME
:CLKWR
:C
DB 10
:L
KH 1500
:T
DW 0
:L
KH 9555
:T
DW 1
:L
KH 1010
:T
DW 2
:L
KH 9308
:T
DW 3
:MBR EEC00
:
:LRW +10
:
:SLD 4
:MAB
:L
KB 1
:JU
OB 121
:L
KB 0
:><F
:JC
=ERRO
:BEU
:
ERRO
:
:
:BE
Data block DB 10 contains the following information when OB 121 is called:
0: KH = 1500;
1: KH = 9555;
2: KH = 1010;
3: KH = 9308;
4:
OB 121 transfers the required time parameters from DB 10 to the system data
area RS 96 to RS 99.
6 - 10
Open DB 10
15 seconds (10th .. 100th sec. = 0!)
24 hour mode, 15 hours 55 minutes
the 10th, Tuesday
1993, August
Load start address of the DB list
in the BR
Load the start address of DB 10 in memory
(paragraph address) in ACCU 1
Absolute address of DB 10 (DW 0)
Load content of ACCU 1 into BR register
Load function no. '1' in ACCU-1-L
Set system time
Scan error bits
Jump to error handling
Error handling
CPU 948 Programming Guide
C79000-G8576-C848-04