This waits for a key press from the MDT. The function waits for a maximum number of milliseconds, and if no key press has occurred within the timeout period, the function returns 0 which indicates the timeout. If a key press has been detected before the timeout period, a number identifying the actual key press is returned.
A small buffer is present in the system so that all key presses are received by the application.
Input:
timeout : INT (0..32767) Default 3000
Timeout period in milliseconds to wait.
Returns: INT
127
|
- PowerUP key pressed (only generated when the MDT is in standby mode and the power key is pressed).
|
126
|
- Power key pressed.
|
125
|
- Back key pressed.
|
124
|
- Enter key pressed.
|
123
|
- Right key pressed.
|
122
|
- Left key pressed.
|
121
|
- Down key pressed.
|
120
|
- Up key pressed.
|
105
|
- F6 key pressed.
|
104
|
- F5 key pressed.
|
103
|
- F4 key pressed.
|
102
|
- F3 key pressed.
|
101
|
- F2 key pressed.
|
100
|
- F1 key pressed.
|
21
|
- # key pressed (MDT-200 and NMP only).
|
20
|
- * key pressed (MDT-200 and NMP only).
|
19
|
- "9" key pressed (MDT-200 and NMP only).
|
18
|
- "8" key pressed (MDT-200 and NMP only).
|
17
|
- "7" key pressed (MDT-200 and NMP only).
|
16
|
- "6" key pressed (MDT-200 and NMP only).
|
15
|
- "5" key pressed (MDT-200 and NMP only).
|
14
|
- "4" key pressed (MDT-200 and NMP only).
|
13
|
- "3" key pressed (MDT-200 and NMP only).
|
12
|
- "2" key pressed (MDT-200 and NMP only).
|
11
|
- "1" key pressed (MDT-200 and NMP only).
|
10
|
- "0" key pressed (MDT-200 and NMP only).
|
0
|
- Timeout.
|
-2
|
- MDT not open.
|
Declaration:
FUNCTION mdtGetKey : INT;
VAR_INPUT
timeout : INT := 3000;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
key : INT;
END_VAR;
BEGIN
...
key := mdtGetKey(timeout := 10000);
...
END;
END_PROGRAM;
|