Technical data

"Reading the system time":
You want to write the current system time to data block DB 10 from data
word DW 4. 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
: Number of 1st data field word = 4
:JU OB 150 Call OB 150
:C DB 10 Open DB 10
: Evaluate DB 10
After calling OB 150, the actual system time is stored in the following
form in the data block DB 10 ("Thurs, 24.10.93, 11:30, 20 seconds, 13
hundredths, 24 hour format"):
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 (bits 14/15 = 01), hours = 11
(BCD), Minutes = 30 (BCD)
DW 6: KH= 2 4 3 0 Day of month = 24 (BCD)
Day of week = 3 = Thursday
DW 7: KH= 9 1 1 0 Year = 93 (BCD)
Month = 10 (BCD)
"Setting the time":
(continued)
DB 10
0: KH= 0 0 0 0 left byte = seconds (BCD), right byte = 0
1: KH= 9 1 3 0 91 = format (=80H) + hour (= 11 BCD)
30 minutes (BCD)
2: KH= 2 4 3 0 24 = day of the month (BCD)
30 = day of week (3 = Thursday) + bit 0 to bit 3 = 0
3: KH= 9 1 1 0 93 = year (BCD)
10 = month (BCD)
The STEP 5 operations in OB 1 for calling for OB 150 are as follows:
: Signal edge of the input for setting the system
time has occurred
STELL:L KH1 1 0 A Values for ACCU-2-L:
: Address area type = 1 for "data field in DB"
: Function number = 1 for "set"
:
:L KF +0 ACCU-1-L:
: Number of the 1st data field word = 0
:JU OB 150 Call OB 150
:
Setting/Reading the System Time (OB 150)
CPU 928B Programming Guide
6 - 32 C79000-B8576-C898-01