Advanced Function Instruction
7-93
FUN109
D
P
T_ROT
TABLE ROTATE
FUN109
D
P
T_ROT
Ts : Source table for rotate
Td : Destination table storing results of rotation
L : Lengths of table
Ts, Td may combine with V, Z, P0~P9 to serve indirect
address application
WX
WY
WM
WS
TMR CTR
HR
IR
OR
SR
ROR
DR
K
XR
Range
Ope-
rand
WX0
∣
WX240
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3840
∣
R3903
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
2
∣
256
V
、
Z
P0~P9
Ts
○
○
○
○
○
○
○
○
○
○
○
○
○
Td
○
○
○
○
○
○
○
○
*
○
*
○
○
L
○
○
*
○
○
z
When rotation control "EN" = 1 or "EN
↑
" (
P
instruction) has a transition from 0 to 1, the data from the table of
Ts will be rotated 1 position to the left (when "L/R" = 1)or 1 position to the right (when "L/R" = 0). The results of
the rotation will then be written onto table Td.
X0
EN
T
S
:
Td :
L :
L/R
X1
109P.T_ROT
10
R 0
R 0
z
In the program at left, Ts and Td is the same table. The
table after rotation will write back to itself. It first perform
one left rotation (let X1 = 1, and X0 go from 0
→
1), and
then performs one right rotation (let X1 = 0, and X0 go
from 0
→
1). The results are shown at right in the diagram
below.
Rotate left
Rotate right
(Rotate left)
(Rotate right)
Ts(Td)
Td(Ts)
Td(Ts)
R0
0 0 0 0 (right)
R0
9 9 9 9
R0
0 0 0 0
R1
1 1 1 1
R1
0 0 0 0
R1
1 1 1 1
R2
2 2 2 2
R2
1 1 1 1
R2
2 2 2 2
R3
3 3 3 3
R3
2 2 2 2
R3
3 3 3 3
R4
4 4 4 4
R4
3 3 3 3
R4
4 4 4 4
R5
5 5 5 5
R5
4 4 4 4
R5
5 5 5 5
R6
6 6 6 6
R6
5 5 5 5
R6
6 6 6 6
R7
7 7 7 7
R7
6 6 6 6
R7
7 7 7 7
R8
8 8 8 8
R8
7 7 7 7
R8
8 8 8 8
R9
9 9 9 9 (left)
R9
8 8 8 8
R9
9 9 9 9
Before execution
c
First time
d
Second time
Содержание FBs-CBE
Страница 78: ...MEMO ...
Страница 111: ...4 6 X0 X1 Node A Y0 Y1 Node B differential down Incerse differential up t Scan time Inverse t t ...
Страница 141: ...Basic Function Instruction 6 16 FUN 2 SKP SKIP START FUN 2 SKP Y2 Y1 Y0 T201 10S X0 X1 X2 0 10 0 ...
Страница 305: ...MEMO ...
Страница 348: ...MEMO ...