"Read out system time":
You want the current system time to be written to data block DB 10 from data
word DW 4 onwards. You must therefore call OB 150 with the following
parameters:
:
:
:L KH 2 1 0 A Values for ACCU-2-L:
: DB no. = 10
: Address area type = 1 for "data field in DB"
: Function no. = 2 for "read"
:L KF +4 ACCU-1-L:
: No. of 1st data field word = 4
:JU OB 150 Call OB 150
:C DB 10 Open DB 10
: Evaluate DB 10
After OB 150 is called, the current system time is written to data block DB
10 in the following form ("Thurs, 24.10.93, 11:30 hours 20 seconds, 13/100
of a second, 24 hour clock"):
DW 4: KH = 2 0 1 3 Seconds = 20 (BCD)
1/100 seconds = 13 (BCD)
DW 5: KH = 9 1 3 0 Format = 24 hour (bit 15 = 1, bit 14 = 0),
Hour = 11(BCD), minutes = 30 (BCD)
DW 6: KH = 2 4 3 0 Day of month = 24 (BCD)
Weekday = 3 = Thursday
DW 7: KH = 9 3 1 0 Year = 93 (BCD)
Month = 10 (BCD)
"Set system time"
(continued)
STEP 5 operations in OB 1 for calling OB 150:
:
:
:L KH 1 1 0 A Values for ACCU-2-L:
: DB no. = 10
: Address area type = 1 for "data field in DB"
: Function no. = 1 for "set"
:L KF +0 ACCU-1-L:
: No. of 1st data field word = 0
:JU OB 150 Call OB 150
:
OB 150: Set/Read System Time
CPU 948 Programming Guide
6 - 42 C79000-G8576-C848-04