Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 829

Table of Contents

Advertisement

D2: Key Input Word
Bits 00 to 10 of D2 indicate key inputs. When one of the keys on the keypad (0 to 9) has been pressed,
the corresponding bit of D2 (0 to 9) is turned ON. Bit 10 of D2 will be ON while any key is being
pressed.
15
14
13
12
D
2
ON when any
key is pressed.
ON when the
corresponding key is
pressed. (Remains on
until another key is
pressed.)
Note TKY(211) does not require a system word, unlike other I/O instructions such as HKY(212).
Operand Specifications
Word addresses
Area
CIO
WR
HR
I
D1
OK
OK
OK
D2
Flags
Name
Error Flag
Function
TKY(211) reads numeric data from input word I, which is allocated to a ten-key keypad connected to an
Input Unit, and stores up to 8 digits of BCD data in register words D1 and D1+1. In addition, each time
that a key is pressed, the corresponding bit in D2 (0 to 9) will be turned ON and remains ON until
another key is pressed. Bit 10 of D2 will be ON while any key is being pressed and OFF when no key is
being pressed.
External Connections
Connect the ten-key keypad so that the switches for keys 0 through 9 are input to contacts 0 through 9
of the Input Unit, as shown in the following diagram.
ID212
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
COM
COM
0 V
DC Input Unit
CS/CJ/NSJ Series Instructions Reference Manual (W474)
11
10
9
8
7
6
5
4
3
2
9
8
7
6
Indirect DM/EM
@DM
AR
T
C
DM
EM
@EM
OK
OK
OK
OK
OK
OK
Label
P_ER
OFF
0
9
10-key
1
0
0
1
2
ON when the
3
corresponding key is
4
pressed. (Remains on
5
until another key is
pressed.)
Registers
addresses
Con-
stants
*DM
DR
*EM
OK
OK
---
---
OK
Operation
3. Instructions
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
---
3
TR
bits
---
793

Advertisement

Table of Contents
loading

Table of Contents