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

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-82
5.8.2
HKY (FNC 71)
Operation 1 - Standard:
This instruction creates a multiplex of 4 outputs
(D
1
) and 4 inputs (S) to read in 16 different
devices. Decimal values of 0 to 9 can be stored
while 6 further function flags may be set.
Points to note:
a) Each of the first 10 multiplexed source devices (identified as 0 to 9) map directly to decimal
values 0 to 9. When entered, i.e. a source device is activated, then its associated decimal
value is added to the data string currently stored in D
2
. Activation of any of these keys
causes bit device D
3+7 
to turn ON for the duration of that key press.
b) The last 6 multiplexed source devices (identified as function keys A to F) are used to set bit
devices D
3+0 
to D
3+5 
respectively. These bit flags, once set ON, remain ON until the next
function key has been activated. Activation of any of these keys causes bit device D
3+6 
to
turn ON for the duration of that key press.
c) In all key entry cases, when two or more keys are pressed, only the key activated first is
effective. When the pressing of a key is sensed the M8029 (execution complete flag) is
turned ON. When the HKY instruction is OFF, all D
devices are reset but data value D
2
remains intact.
d) When the HKY instruction is used with 16 bit
operation, D
can store numbers from 0 to 9,999
i.e. max. 4 digits. When the DHKY instruction is
used (32 bit operation) values of 0 to 99,999,999
(max. 8 digits) can be accommodated in two
consecutive devices D
and D
2+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 over-flowed
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. This
operation is similar to that of the TKY instruction.
Mnemonic
Function 
Operands
Program steps
S
D
1
D
2
D
3
HKY
FNC 71
(Hexadeci-
mal
key input)
Multiplexes inputs
and outputs to
create a numeric
keyboard with 6
function keys
X,
Note:
uses 4
consecu-
tive
devices
Y,
Note:
uses 4
consecu-
tive
devices
T, C, D, V, Z
Note: uses 2
consecutive
devices
for 32 bit
operation
Y, M, S
Note:
uses 8
consecu-
tive
devices
HKY:
9 steps
DHKY:
17 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
FLAGS
Operation
Complete M8029
X4
Y 0
D 0
[ D2 ]
M0
HKY
[ D1 ]
X 0
[ S ]
[ D3 ]
X0
X1
X2
X3
24V 0V S/S
Y2
Y3
+V
Y0
Y1
1
2
3
4
5
6
7
9
0
D
8
C
B
A
E
F
Input keys-
0-9,A-F
Transistor Outputs (source)