![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bgcf.png)
FX Series Programmable Controlers Applied Instructions 5
5-81
5.8.1 TKY (FNC 70)
Operation:
This instruction can read from 10 consecutive
devices(S
+0
to S
+9
) and will store an entered
numeric strin
in device D
1
.
Points to note:
a) When a source device becomes active its associated destination (bit) device D
2
also
becomes active. This destination device will remain active until another source device is
operated. Each source device maps directl
to its own D
2
device, i.e. S
+0
maps to D
2+0
, S
+7
maps to D
2+7
etc. These in turn, map directl
to decimal values which are then stored in the
destination data devices specified b
D
1
.
b) One source device ma
be active at an
one time. The destination device D
2+10
is used to
si
nif
that a ke
(one of the 10 source devices) has been pressed. D
2+10
will remain active
for as lon
as the ke
is held down. When the TKY instruction is active, ever
press of a ke
adds that di
it to the stored number in D
1
. When the TKY is OFF, all of the D
2
devices are
reset, but the data value in D
1
remains intact.
c) When the TKY instruction is used with 16 bit operation, D
1
can store numbers from 0 to
9,999 i.e. max. 4 di
its. When the DTKY instruction is used (32 bit operation) values of 0 to
99,999,999 (max. 8 di
its) can be accommodated in two consecutive devices D
1
and D
1+1
.
In both cases if the number to be stored exceeds the allowable ran
es, the hi
hest di
its
will overflow until an allowable number is reached. The overflowed di
its are lost and can
no lon
er be accessed b
the user. Leadin
zero’s are not accommodated, i.e. 0127 will
actuall
be stored as 127 onl
.
d) The TKY instruction ma
onl
be used
ONCE
.
e) Usin
the above instruction as a brief example: If the
‘ke
s’ identified (a) to (d) are pressed in that order
the number 2,130 will be entered into D
1
. If the ke
identified as (e) is then pressed the value in D
1
will
become 1,309. The initial ‘2’ has been lost.
Mnemonic Function
Operands
Program steps
S
D
1
D
2
TKY
FNC 70
(
Ten ke
input)
Reads 10 devices
with associated
decimal values
into a sin
le
number
X, Y, M, S
Note: uses 10
consecutive
devices
(identified as
S
+0
to S
+9
)
KnY, KnM,
KnS,
T, C, D, V, Z
Note: uses 2
consecutive
devices for 32
bit operation
Y, M, S
Note: uses 11
consecutive
devices
(identified
D
2+0
to D
2+10)
TKY:
7 steps
DTKY:
13 steps
X30
X 0 D 0
[ S ]
[ D2 ]
M 10TKY
[ D1 ]
M10
M11
M12
M13
M20
(a) (b) (c) (d)
(a)
(b)
(c)
(d)
X0
X1
X2
X3
.
.
.
X11X0 X1 X2 X3 X4 X524V 0V S/S X6 X7
0 1 2 3 4 5 6 7 8 9
X10
(a)(b) (c)(d) (e)
Example key connections
Input 'keys'and their decimal values