Example 1
1.
The instruction clears the value of the pointer D0 to 0 first. When M0 switches from OFF to ON, the instruction
writes the data in D20 into D1, and increments the value in D0 to 1. When M0 switches from OFF to ON again, the
instruction writes the data in D20 to D2, and increments the value in D0 to 2.
2.
The instruction shifts and writes the data in the word device as shown below.
The data in D20 is written into D1.
The value in D0 becomes 1.
Sourc e
D20
D9
D8
n=10
D7
D6
D5
D4
D0=3
C ha pt er 6 A p pl i e d In s tr uc t io ns
D3
D2
D1
D0
Pointer
2
1
6_
6 - 3 2 5