DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-166
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
The following ladder example assumes the data at V3000 to V3004 already exists as shown
above. We will use input X0 to trigger the Table Shift Right operation. First, we will load the
table length (5 words) into the accumulator stack. Next, we load the starting address into the
accumulator. Since V3000 is an octal number, we have to convert it to hex by using the LDA
command. Finally, we use the Table Shift Right instruction and specify the number of bits to
be shifted (12 decimal), which is 14 octal.
1 2 3 4
5 6 7 8
1 1 2 2
3 3 4 4
6 7 8 1
1 2 2 5
3 4 4 1
5 6 6 3
5 5 6 6
0 0 0 5
V 3000
V 3000
DirectSOFT 32
X0
LD
K5
LDA
0 3000
TSHFR
0 14
Load the constant value 5
(Hex.) into the lower 16 bits
of the accumulator.
Convert octal 3000 to HEX
and load the value into the
accumulator. This is the
table beginning.
Do a table shift right by 12
bits, which is 14 octal.
Handheld Programmer Keystrokes
STR
$
SHFT
ANDST
L
3
D
SHFT
MLR
T
RST
S
7
H
PREV
0
A
ENT
5
F
0
A
0
A
ENT
SHFT
ANDST
L
3
D
3
D
0
A
0
A
ENT
1
B
4
E
ENT
SHFT
5
F
ORN
R
NEXT
Discrete Bit Flags
Description
SP53
On when the number of bits to be shifted is larger than the total bits contained within the table
SP67
On when the last bit shifted (just before it is discarded) is a 1
Direct
SOFT
The example table to the right contains
BCD data as shown (for demonstration
purposes). Suppose we want to do a table
shift right by 3 BCD digits (12 bits).
Converting to octal, 12 bits is 14 octal.
Using the Table Shift Right instruction
and specifying a shift by octal 14, we have
the resulting table shown at the far right.
Notice that the 2–3–4 sequence has been
discarded, and the 0–0–0 sequence has
been shifted in at the bottom.
NOTE: Status flags are only valid until the end of the scan or another instruction that uses the same
flag is executed.