"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
Summary of Contents for CPU 948
Page 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Page 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Page 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Page 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Page 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Page 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Page 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Page 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Page 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Page 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Page 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Page 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Page 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Page 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Page 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Page 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...