Examples of DO operations
DO DW/DO FW
Operand substitution
Using the statements "DO DW" and "DO FW" you can access data with a
substitution, e.g. in a program loop. The substituted access consists of the
statement DO DW/DO FW followed immediately by one of the STEP 5
operations listed above.
"Substituted" means that the operand for the operation is not programmed
as a static value but is fixed during the course of the STEP 5 program.
Select the operand type from the range permitted for the operation when
you write your program, e.g. PB for the operation "JU PB nn":
You must first load the operand value (nn in the example) in a data word
or F flag word (parameter word) before the substituted access with
DO DW/DO FW.
1.
Principle of substitution:
:L
KF +120
:T
FW 14
load FW with the value "KF +120"
:DO
FW 14
:L
IB 0
before the operation "L IB" is executed, the
operand value ’0’ is replaced by the value ’120’;
Operation executed:
L IB 120
2.
Data word as index register:
The contents of data words DW 20 to DW 100 are set to signal state ’0’. The
index register for the parameter of the data words is DW 1.
:L
KF +20
supply the index register
:T
DW 1
M001
:L
KF +0
reset
:DO
DW 1
:T
DW 0
:L
DW 1
increment the index register
:L
KF +1
:+F
:T
DW 1
:L
KF +100
:<=F
:JC
=M001
jump if the index is within the range
...
remaining STEP 5 program
Continued on next page
Executive Operations
CPU 948 Programming Guide
3 - 68
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 ...