3. Instruction

Set

API

Mnemonic

 

 

Operands

Function

 

 

Controllers

 

71

D

HKY

 

 

 

Hexadecimal key input

 

ES2/EX2 SS2 SA2 SX2

 

 

 

 

SE

 

Type

Bit Devices

 

Word devices

 

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K H KnX KnY KnM KnS T

C

D

E

F

HKY: 9 steps

 

S

 

*

 

 

 

 

 

 

 

 

 

DHKY: 17 steps

 

D1

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D2

 

 

 

 

 

 

*

*

*

*

*

 

 

D3

 

 

*

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

16-bit

 

32-bit

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

SE

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

 

S: The start of input devices (occupies 4 consecutive devices)

D1: The start of output devices

 

(occupies 4 consecutive devices) D2: Device for storing key input value

D3: 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 D1. By matrix scan, the key input value will be stored in D2. D3 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.D2 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

3 - 1 8 5

Page 301
Image 301
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Hky