Advanced Function Instruction
7 -8 6
FUN102
D
P
T
→
T
TABLE TO TABLE MOVE
FUN102
D
P
T
→
T
Ts :
EN
Move control
Ladder symbol
102DP.T T
Td :
END
Move to end
ERR
Pointer error
Pointer increment
PAU
Pointer clear
CLR
L :
Pr :
Ts : Starting number of source table register
Td : Starting number of destination table
register
L : Table (Ts and Td) length
Pr : Pointer register
Ts, Rd 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
∣
2048
V
、
Z
P0~P9
Ts
○
○
○
○
○
○
○
○
○
○
○
○
○
Td
○
○
○
○
○
○
○
○
*
○
*
○
○
L
○
○
*
○
○
Pr
○
○
○
○
○
○
○
○
*
○
*
○
z
When move control "EN" = 1 or "EN
↑
" (
P
instruction) have a transition from 0 to 1, the register Tspr pointed
by pointer Pr within the source table will be moved to a register Tdpr, which also pointed by the pointer Pr in the
destination table. Before execution, it will first check the input signal of pointer clear "CLR". If "CLR" is 1, it will
first clear Pr to 0 and then do the move (in this case Ts0
→
Td0). After the move action has been completed it
will then check the value of pointer Pr. If the Pr value has already reached L-1 (point to the last register on the
table), then it will set the move-to-end flag "END" to 1 and finish executing of this instruction. If the Pr value is
less than L-1, it will check the status of "INC". If "INC" is 1, then the Pr value will be increased by 1 before
execution. Besides, pointer clear "CLR" can execute independently, and will not be influenced by other input.
z
The effective range of the pointer is 0 to L-1. Beyond this range, the pointer error flag "ERR" will be set to 1,
and this instruction will not be carried out.
EN
R 0
END
Td : R 10
L :
Pr :
INC
CLR
ERR
X0
102P.T T
T
S
:
10
R 20
z
The diagram at left below is the status before execution.
When X0 from 0
→
1, the content of R5 in Ts table will copy to
R15 and pointer R20 will be increased by 1.
Pr
Pr
R20
5
R20
6
Ts
Td
Td
R0
1 1 1 1
R10
0 0 0 0
R10
0 0 0 0
R1
1 1 1 1
R11
0 0 0 0
R11
0 0 0 0
R2
1 1 1 1
R12
0 0 0 0
R12
0 0 0 0
R3
1 1 1 1
R13
0 0 0 0
R13
0 0 0 0
R4
1 1 1 1
R14
8 8 8 8
R14
8 8 8 8
R5
1 1 1 1
R15
0 0 0 0
R15
1 1 1 1
R6
1 1 1 1
R16
0 0 0 0
R16
0 0 0 0
R7
1 1 1 1
R17
0 0 0 0
X0
=
Ö
R17
0 0 0 0
R8
1 1 1 1
R18
0 0 0 0
R18
0 0 0 0
R9
1 1 1 1
R19
0 0 0 0
R19
0 0 0 0
Before execution
result