Mitsubishi Electronics FX3G User Manual

Page of 964
427
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
15 External FX I/O Device – FNC 70 to FNC 79
15.2 FNC 71 – HKY / Hexadecimal Input
11
FN
C30
-FN
C3
9
R
ota
tion and 
Shi
ft
12
FN
C40-FN
C49
D
ata O
perati
on
13
FNC
50-FNC
59
High-Speed
 
Proc
essing
14
FM
C60-FN
C69
H
andy 
In
struction
15
FN
C70-FN
C79
E
xternal
 F
X
 I/O
 
De
vice
16
FNC
80-FNC
89
External
 FX 
Dev
ice
17
FNC1
00-
FNC10
9
Dat
Transfer 2
18
FNC1
10-
FNC139
Fl
oati
ng Poi
nt
19
FNC14
0-F
N
C
149
Da
ta
 
Operation 2
20
FNC1
50-
FNC159
Pos
itioning 
Control
2. 32-bit operation (DHKY)
Hexadecimal numerical value data input using keys 0 to F is shifted into [
+1, 
] from the least significant
byte.
1) Input of a numeric value using keys 0 to F: 
- When the input value is larger than "FFFFFFFF", it overflows from the most significant digit.
- Example:
When "9 
→ 2 → 3 → B → F → A → F" is input, numerical value "923BFAF" is stored in [
+1, 
] in 
binary.
Related devices
→ For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Cautions
1. Limitation in the number of instructions
The HKY or DHKY instruction can only be used once in a program.
When the TKY and/or DTKY instruction should be used two or more times, use the indexing (V, Z) function.
2. When two or more keys are pressed at the same time
In such a case, the first key pressed is valid.
3. When the command contact turns OFF
Though the contents of 
 do not change, 
 to 
+7 turn OFF.
4. Number of devices occupied
1) Four devices are occupied from the head X device 
 for connecting 16 keys.
2) Four devices are occupied from the head Y device 
 for connecting 16 keys.
3) Eight devices are occupied from the head device 
 for outputting the key pressing information.
Make sure that these devices are not used by other machine controls.
-
 to 
+5: Key pressing information for the keys A to F
-
+6: Key sensing output for the keys A to F
-
+7: Key sensing output for the keys 0 to 9
5. Key input receiving timing
HKY and DHKY instructions are executed in synchronization with the operation cycle of the PLC.
8 scan cycles are required to finish reading the keys.
To prevent key input receiving errors caused by the filter delay, utilize the "constant scan mode" and "timer interrupt"
function.
6. Caution on use in timer interrupt programs
When the HKY instruction is used in a timer interrupt program, it turns ON M8029 in the interrupt program.
→ For details, refer to Subsection 36.5.2.
7. Output format
Use a transistor output type PLC.
Device
Name
Description
M8167
Extension function flag
Turns ON/OFF the hexadecimal data handling function of HKY (FNC 71) instruction.
OFF:
Ten-keys and function keys
ON:
Hexadecimal keys
M8029
Instruction execution com-
plete flag
OFF:
Data is being output to 
 to 
+3 or the instruction is not executed yet.
ON:
A cycle operation of outputting data to 
 to 
+3 (scan of the keys 0 to F) is
completed.
  
D
2
  
D
2
  
D
2
  
D
2
Command
input
FNC 71
DHKY
M8167
D
1
 
D
2
 
D
3
 
  
D
1
  
D
1
  
D
1
  
D
1
  
D
2
  
D
3
  
D
3
   
S
  
D
1
  
D
3
  
D
3
  
D
3
  
D
3
  
D
3