Advanced Function Instruction
7-90
FUN106
D
P
T-T_C
TABLE TO TABLE COMPARE
FUN106
D
P
T-T_C
Ta : Starting register of Table a
Tb : Starting register of Table b
L : Lengths of Table
Pr : Pointer
Ta, Tb 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
Ta
○
○
○
○
○
○
○
○
○
○
○
○
○
Tb
○
○
○
○
○
○
○
○
○
○
○
○
○
L
○
○
*
○
○
Pr
○
○
○
○
○
○
○
○
*
○
*
○
z
When comparison control "EN" = 1 or "EN
↑
" (
P
instruction) has a transition from 0 to 1, then starting from the
first register in the tables Ta and Tb (when "FHD" = 1 or Pr value has reached L-1) or starting from the next
pair of registers (Tapr+1 and Tbpr+1) pointed by Pr ("FHD" = 0, while Pr is less than L-1), this instruction will
search for pairs of registers with different values (when "D/S" = 1) or the same value (when "D/S" = 0). When
search found (either different or the same), it will immediately stop the search and the pointer Pr will point to
the register pairs met the search criteria. The found flag "FND" will be set to 1. When it has searched to the last
register of the table, the instruction will stop executing. whether it found or not. The compare-to-end flag "END"
will be set to 1, and the pointer value will stop at L-1. When this instruction is executed next time, Pr will
automatically return to the head of the table to begin the search.
z
The effective range of Pr is 0 to L-1. The Pr value should not changed by other programs during the operation.
As this will affect the result of the search. If the Pr value not in the effective range, the pointer error flag "ERR"
will be set to 1, and this instruction will not be carried out.
X0
EN
Ta :
106P.T-T_C
END
Tb : R 11
L :
Pr :
FHD
D/S
ERR
10
R 10
FND
R 0
z
The instruction at left starts from the register next to the register
pointed by the pointer (because "FHD" is 0) to search for register
pairs with different data (because "D/S" is 1) within the 2 tables.
At the very beginning, Pr points to Ta1 and Tb1. There are 3
different pairs of data at the position 1,3,6 of the table.
However, it does not compare from the beginning, and this
instruction will start searching from position 3 downwards. After
X0 has changed 3 times from 0 to 1, the results are shown in the
diagram below.
Pr
R10
1
Ta
Tb
Pr
F
E
R0
0 0 0 0
R11
0 0 0 0
R10
3 1
0
R1
1 1 1 1
R12
0 0 0 0
R2
2 2 2 2
R13
2 2 2 2
←
R3
3 3 3 3
R14
1 2 3 4
c
X0
=
(First)
Pr
F
E
R4
4 4 4 4
R15
4 4 4 4
Start
point
R10
6 1
0
R5
5 5 5 5
R16
5 5 5 5
R6
6 6 6 6
R17
0 0 0 0
R7
7 7 7 7
R18
7 7 7 7
d
X0
=
(Second)
Pr
F
E
R8
8 8 8 8
R19
8 8 8 8
R10
9 0
1
R9
9 9 9 9
R20
9 9 9 9
e
X0
=
(Third)
Before execution
After execution
Содержание 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 ...