613
KEY
1
2
3
4
4
6
7
8
7.18
Ot
her inst
ructions
7.18.7
KEY
F
unct
i
on
(1) Fetches ASCII data from the 8 points of input (X) designated by , converts it to hexadecimal values and stores the
result in the area starting from the device designated by .
For example, in a case where the number of digits (n) of input data has been set at 5, and the values "31
H
", "33
H
", "35
H
",
"37
H
" and "39
H
" have been input through X10 to X18 of the input module, the following will take place:
(2) Numerical input to input (X) designated by undergoes bit development at through +7 and is input as the ASCII
code corresponding to the numbers.
ASCII code which can be input is from 30
H
(0) to 39
H
(9), and from 41
H
(A) to 46
H
(F).
(3) After ASCII code is input to to +7, the strobe signal at +8 goes ON to incorporate the designated numbers
internally.
The strobe signal should be held at its ON or OFF status for more than one scan of the sequence program.
If this time is less than 1 scan, there will be cases when the data is correctly incorporated.
(4) Be sure to keep the execution command (condition contact for the KEY instruction) ON until the specified number of
digits has been input.
The KEY instruction cannot be executed if the execution command turns OFF.
S
D1
Number of digits that are input
5 digits
6 digits
7 digits
8 digits
1 digit
2 digits
3 digits
4 digits
Designation of
the number of
digits to be input
"0" (30 ) to "9" (39 )
H
H
"A" (41 ) to "F" (46 )
H
H
b12
b8
b11
b7
b4
b0
b3
Strobe signal
Input module
D1
n
b15
D1
D1
S
S
S
S
S
S
S
S
S
+1
+2
+1
+2
+3
+4
+5
+6
+7
+8
5
D1
+
1
3
H
5
H
7
H
9
H
0
H
0
H
0
H
1
H
D1
+
2
b15
b12
b8
b11
b7
b
4
b0
b3
5
"
1
3
5
7
9
"
(31
H
)(33
H
)(35
H
)(37
H
)(39
H
)
Strobe
s
i
gna
l
I
nput
modu
l
e
D1
N
umber
of
d
i
g
i
ts
of
i
nput
data
(n)
X10
X11
X12
X13
X1
4
X15
X16
X17
X18
T
he
f
i
rst
i
nput
v
a
l
ue
S
S
S
Input module
"1"(31
H
)= 0
b7
b4
b0
b3
0 1 1 0 0 0 1
(3
H
)
(1
H
)
S
S
S
S
S
S
S
S
+1
+2
+3
+4
+5
+6
+7
S
S
S
31
H
32
H
33
H
34
H
Execution command
Condition contact for
the execution of KEY
instruction
Strobe signal (
+8)
ASCII code input
(
to
+7)
S
S
S
ON for 1 scan
or longer
OFF for 1 scan
or longer
Fetches "1"
Fetches "2"
Fetches "3"
Fetches "4"