433
Advanced I/O Instructions
Section 5-31
If the input word for connecting the hexadecimal keyboard is specified at IW,
and the output word is specified at OW, then operation will proceed as shown
below when the program is executed.
SR 25408 will turn ON while HKY(––) is being executed.
Note
1.
Do not use HKY(––) more than once within the same program.
2.
When using HKY(––), set the input constant for the relevant input word to
less than the cycle time. (Input constants can be changed from DM 6620
onwards.)
3.
While one key is being pressed, input from other keys will not be accepted.
4.
If more than eight digits are input, digits will be deleted beginning with the
leftmost digit.
5.
Input and output bits not used here can be used as ordinary input and out-
put bits.
With this instruction, one key input is read in 3 to 12 cycles. More than one
cycle is required because the ON keys can only be determined as the outputs
are turned ON to test them.
Application Example
This example shows a program for inputting numbers from a hexadecimal
keyboard. Assume that the hexadecimal keyboard is connected to IR 000
(input) and IR 100 (output).
0000
1 2 3 4 5 6 7 8
0000
D+1
D
0000
D+1
000F
D
9 101112
0000
D+1
00F9
D
IW
16-key
0
to
9
to
D+2
00
to
09
to
15
OW
04
F
00
01
02
03
Once per 12 cycles
16-key selection
control signals
Status of 16 keys
Turn ON flags corre-
sponding to input
keys (The flags re-
main ON until the
next input.)
ON for a 12-cycle
period if a key is
pressed.
0
HKY
000
100
DM1000
@XFER(70)
#0002
DM1000
DM0000
00015
25313 (Always ON)