313
4
4 Instructions 4.12.2 Bit Switch Access
4.12.2 Bit Switch Access
Bit switch access
TKY Ten key input
HKY Hexadecimal key input
DSW Digital switch
DECO Data decoding
ENCO Data encoding
TKY: Ten key input
◆
Overview
The TKY instruction assigns a 4- or 8-digit value to a word element through 10 consecutive bit elements
and drives the corresponding bit elements to act.
TKY S D1 D2
Ten key input Applicable model:
H3U
S
Input port
head address
Initial key input port (for example, X port), with 10
consecutive units occupied
16-bit instruction
(7 steps)
TKY: Continuous
execution
32-bit instruction (13
steps)
DTKY: Continuous
execution
D1
Data storage
unit
Address at which key input data is stored
D2
Input signal
indicator
Head address of 11 consecutive bit elements that
store the actions corresponding to key input
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
Ten consecutive bit variable units (for example, X input ports) are designated to represent the 0 to 9 keys in
decimal format. When key press actions are initiated (status: ON), 4-digit decimal values in the range 0 to
9999 can be input based on the action sequence. If the 32-bit instruction is used, 8-digit decimal values in
the range 0 to 99,999,999 can be input.
●
Example
The following gure shows the hardware wiring diagram.
PLC
X0 X1 X3 X5X4X2 X7 X11X10X624V
0V
S/S
0 1 2 3 4 7 8 9