315
4
4 Instructions 4.12.2 Bit Switch Access
◆
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
D3
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
Sixteen keys in a 4x4 matrix are read to represent the 0 to 9 keys in decimal format and the A to F function
keys. When key press actions are initiated (status: ON), 4-digit decimal values in the range 0 to 9999 can
be input or the A to F function keys can be operated 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 or the A to F function keys can be
operated based on the action sequence.
This instruction is only applicable to PLCs of the transistor output type.
●
Example
X20
〔HKY X0 Y0 D0 M0 〕
S D1 D2
D3
The wiring diagram and parameter response description are as follows:
PLC
X0
X2COM X1 X3
Y0
Y2
COM1
Y1 Y3
Numeric keys 0 to 9
Thousands
place
Hundreds
place
Tens
place
Ones
place
Overflow
The BCD value is
converted to a BIN equivalent,
which is stored in D0.
'
Function keys A to F
0
˖
to
ON when any key from
is pressed
0 0 0 0 0
0
0
˖
0 1 2 3 4 5 6 7 8
A B C D E F
A F
to
ON when any key from
is pressed
0 9
9
C D E F
8 9 A B
4 5 6 7
0 1 2 3
Mutually exclusive. Only the M variable that corresponds to
the currently valid key is set to ON. When multiple keys are
pressed at the same time, the first one is ON.
1. A controller of the MT transistor type is required due to the great
output delay of relays.
2. When the drive flow X20 is OFF, D0 remains unchanged, and M0
to M7 are set to OFF.
3. It takes eight scan cycles to complete a key scan operation. After
scanning, M8029 is set by one scan cycle.
Because it takes several cycles to complete key scanning, enable the constant scan mode or timing
interrupt processing to avoid the impact of X port lter.
●
Extended function
When the special variable M8167 is set to ON, this instruction stores keys 0
8
to 9
8
in hexadecimal format in
D2.