Справочник Пользователя для Mitsubishi Electronics FX

Скачать
Страница из 382
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 string in device D
1
.
Points to note:
a) When a source device becomes active its associated destination (bit) device D
also
becomes active. This destination device will remain active until another source device is
operated. Each source device maps directly to its own D
device, i.e. S
+0 
maps to D
2+0
, S
+7
maps to D
2+7 
etc. These in turn, map directly to decimal values which are then stored in the
destination data devices specified by D
1
.
b) One source device may be active at any one time. The destination device D
2+10 
is used to
signify that a key (one of the 10 source devices) has been pressed. D
2+10 
will remain active
for as long as the key is held down. When the TKY instruction is active, every press of a key
adds that digit to the stored number in D
1
. When the TKY is OFF, all of the D
devices are
reset, but the data value in D
remains intact.
c) When the TKY instruction is used with 16 bit operation, D
can store numbers from 0 to
9,999 i.e. max. 4 digits. When the DTKY instruction is used (32 bit operation) values of 0 to
99,999,999 (max. 8 digits) 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 ranges, the highest digits
will overflow until an allowable number is reached. The overflowed digits are lost and can
no longer be accessed by the user. Leading zero’s are not accommodated, i.e. 0127 will
actually be stored as 127 only.
d) The TKY instruction may only be used ONCE.
e) Using the above instruction as a brief example: If the
‘keys’ identified (a) to (d) are pressed in that order
the number 2,130 will be entered into D
1
. If the key
identified as (e) is then pressed the value in D
will
become 1,309. The initial ‘2’ has been lost.
Mnemonic
Function 
Operands
Program steps
S
D
1
D
2
TKY
FNC 70
(
Ten key 
input)
Reads 10 devices
with associated
decimal values
into a single
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
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X30
X 0
D 0
[ S ]
[ D2 ]
M 10
TKY
[ D1 ]
M10
M11
M12
M13
M20
(a)
(b)
(c)
(d)
(a)
(b)
(c)
(d)
X0
X1
X2
X3
.
.
.
X11
X0 X1 X2 X3 X4 X5
24V 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