3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-201
API Mnemonic
Operands
Function
71
D HKY
S
,D
1
, D
2
, D
3
Hexadecimal Key Input
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
*
D
1
*
D
2
*
*
*
*
*
D
3
*
*
*
HKY: 9 steps
DHKY: 17 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Starting scan input address (occupies 4 consecutive bits)
D
1
: Starting scan output address
(occupies 4 consecutive bits)
D
2
: Destination for storing the key input value
D
3
: Key input signal
(occupies 8 consecutive bits)
Description:
1.
This instruction creates a 16-key keyboard by multiplexing 4 consecutive external inputs, with
the starting input address entered into parameter
S
and 4 consecutive external outputs with
the starting output address entered into parameter
D
1
. The key input value will be stored in
D
2
.
D
3
stores the condition of keys A~F and indicates the key input status of 0~9 and A~F.
2.
Every time this instruction is executed, the execution complete flag M1029 = ON for the
duration the key is pressed (one scan cycle).
3.
If two or more keys are pressed at the same time, only the key activated first will be used.
4.
When the HKY instruction is used in a 16-bit instruction,
D
2
can store numbers from 0 to 9,999
(max. 4 digits). When DHKY instruction is used in a 32-bit instruction (DHKY),
D
2
can store
numbers from 0 to 99,999,999 (max. 8 digits). If the entered number exceeds the allowable
ranges, the highest digits will overflow.
5. For
ELC-PC/PA/PH,
S, D
1
and
D
2
do not support the E, F index registers.
6.
There is no limit on the number of times this instruction can be used in the program, but only
one instruction is allowed to be executed at a time.
Program Example:
Use this instruction to create a 16-key keyboard which multiplexes 4 continuous external input
devices X20~X23 and 4 continuous external output devices Y20~Y23. When X4=ON, the instruction
is executed and it will store the BIN value of the 4 inputs into D0. M0~M7 in this example are used to
store the condition of the key that has been pressed last.
X4
HKY
X20
Y20
D0
M0
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...