Delta DVP-ES2 User Manual
Page 301
3 . I n s t r u c t i o n S e t
3 - 1 8 5
API Mnemonic
Operands
Function
71
D HKY
Hexadecimal key input
Controllers
ES2/EX2 SS2 SA2
SE
SX2
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
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2
Operands:
S: The start of input devices (occupies 4 consecutive devices) D
1
: The start of output devices
(occupies 4 consecutive devices) D
2
: Device for storing key input value D
3
: Key input status
(occupies 8 consecutive devices)
Explanations:
164. This instruction creates a 16-key keyboard by a multiplex of 4 consecutive external input
devices from S and 4 consecutive external output devices from D
1
. By matrix scan, 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 both 0~9 and A~F..
165. M1029 = ON for a scan cycle every time when a key is pressed.
166. If several keys are pressed, only the first pressed key is valid.
167. D
2
maps to a decimal value, a 4-digit decimal value 0~9,999 (16-bit instruction) or an 8-digit
value 0~99,999,999 (32-bit instruction). If the entered number exceeds the available range, i.e.
4 digit in 16-bit and 8 digits in 32-bit instruction, the highest digit performs overflow
168. There is no limitation on the times of using this instruction in the program, but only one
instruction is allowed to be executed in the same scan time.
Program Example:
169. Designate 4 input points X20 ~ X23 and the other 4 output points Y20 ~ Y23 to construct a
16-key keyboard. When X4 = ON, the instruction will be executed and the keyed-in value will
be stored in D0 in BIN form. The key status will be stored in M10 ~ M19.
X4
HKY
X20
Y20
D0
M0