EDH0162En1040 – 06/99
3.190
MM4005
YK — Read key to variable
Usage
IMM
PGM
MIP
Syntax
xxYK
Parameters
Description
xx
[int]
— Variable number.
Range
xx
—
1
to
100
(integers) and
101
to
120
(floats).
Units
xx
— None.
Defaults
xx
Missing: Error O.
Out of range: Error O.
Floating point: Error A.
Description
This command reads the front panel keys and if one is pressed, it places its
ASCII code in variable
xx
. If no key is pressed at the time of testing, the
variable is set to zero. The following table lists all possible values returned.
Key
ASCII
Variable
pressed
code
value
None
None
0
0
48
1
49
2
50
3
51
4
52
5
53
6
54
7
55
8
56
9
57
-
45
.
46
1
st
(Left)
A
65
2
nd
B
66
3
rd
C
67
4
th
(Right)
D
68
Returns
None.
Errors
A
—
Unknown message code.
O
—
Variable number out of range.
Rel. Commands
YW
—
Wait and read key.
Example
5YS0 |
Initialize variable #5 to 0.
5WL1 |
While variable #5 is less than 1, repeat next commands
.
4YK
|
Read keys and place code variable #4.
4YE49, 1PR-0.1 |
If key “1” is pressed, move axis #1 -0.1 units incrementally.
4YE51, 1PR0.1 |
If key “3” is pressed, move axis #1 0.1 units incrementally.
4YE48, 5YS1 |
If key “0” is pressed, set variable #5 to 1 to end loop.
WE |
End while loop.
.
–
9
8
7
6
5
4
3
2
1
0
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com