Mitsubishi Electronics FX2C Home Theater Server User Manual


 
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
g
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
y
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
y
to decimal values which are then stored in the
destination data devices specified b
y
D
1
.
b) One source device ma
y
be active at an
y
one time. The destination device D
2+10
is used to
si
g
nif
y
that a ke
y
(one of the 10 source devices) has been pressed. D
2+10
will remain active
for as lon
g
as the ke
y
is held down. When the TKY instruction is active, ever
y
press of a ke
y
adds that di
g
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
g
its. When the DTKY instruction is used (32 bit operation) values of 0 to
99,999,999 (max. 8 di
g
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
g
es, the hi
g
hest di
g
its
will overflow until an allowable number is reached. The overflowed di
g
its are lost and can
no lon
g
er be accessed b
y
the user. Leadin
g
zero’s are not accommodated, i.e. 0127 will
actuall
y
be stored as 127 onl
y
.
d) The TKY instruction ma
y
onl
y
be used
ONCE
.
e) Usin
g
the above instruction as a brief example: If the
‘ke
y
s’ identified (a) to (d) are pressed in that order
the number 2,130 will be entered into D
1
. If the ke
y
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
y
input)
Reads 10 devices
with associated
decimal values
into a sin
g
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