Advanced Function Instruction
7 -5 6
FUN 76
D
TKEY
DECIMAL- KEY INPUT
FUN 76
D
TKEY
IN : Key input point
D : register storing key-in numerals
KL: starting coil to reflect the input status
D may combine with V, Z, P0~P9 to serve
indirect address application
X
Y
M
S
WY
WM
WS
TMR CTR
HR
OR
SR ROR DR
XR
Range
Ope-
rand
X0
∣
X240
Y0
∣
Y240
M0
∣
M1896
S0
∣
S984
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
V
、
Z
P0~P9
IN
○
D
○
○
○
○
○
○
○
○
*
○
*
○
○
KL
○
○
○
z
This instruction has designated 10 input points IN~IN+9 (IN0~IN9) to one decimal number entry (IN->0,
IN+1->1…). According to the key-in sequence (ON) of these input points, it is possible to enter 4 or 8
decimal numbers into the registers specified by D.
z
When input control "EN" = 1, this instruction will monitor the
10 input points starting from IN and put the corresponding
number into D register while the key were depressed. It will
wait until the input point has released, then monitor the next
"ON" input point, and shift in the new number into D register
(high digit is older than low digit ) . For the 16-bit operand, D
register can store up to 4 digits, and for the 32-bit operand 8
digits may be stored. When the key numbers full fill the D
register, new key-in number will kick out the oldest key
number of the D register. The key-in status of the 10 input
points starting from IN will be recorded on the 10
corresponding coil starting from KL. These coils will set to 1
while the corresponding key is depressed and remain
unchanged even if the corresponding key is released. Until
other key is depressed then it will return to zero. As long as
any input point is depressed (ON), then the key-in flag KPR
will set to 1. Only one of IN0~IN9 key can be depressed at
the same time. If more than one is pressed, then the first
one is the only one taken. Below is a schematic diagram of
the function with 16-bit operand.
Forced out
Key-in
IN0 ~ IN9
BCD Code
9
D
BIN(0~9999)
1000S 100S 10S
1S
1
2
0
z
When input control "EN" = 0, this instruction will not be executed. KPR output and KL coil status will be 0.
However, the numerical values of D register will remain unchanged.
Y0
X20
EN
76.TKEY
D :
KPR
IN :
KL :
R 0
X 0
M 0
˙
The instruction at left represents the input point X0 with
the number "0", X1 is represented by 1, ... , M0 records
the action of X0, M1 records the action of X1 ... , and the
input numerical values are stored in the R0 register.