Mitsubishi Electronics FX3G Manuel D’Utilisation

Page de 964
461
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
16 External FX Device – FNC 80 to FNC 89
16.3 FNC 82 – ASCI / Hexadecimal to ASCII Conversion
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. 16-bit conversion mode (while M8161 is OFF) (M8161 is also used for the RS, HEX, CCD and CRC 
instructions.)
Each digit of hexadecimal data stored in 
 and later is converted into ASCII code, and transferred to the high-
order 8 bits and low-order 8 bits of each device 
 and later. The number of digits (characters) to be converted is
specified by "n".
Each ASCII code is stored in either the high-order 8 bits or low-order 8 bits of each device 
 and later.
M8161 is used also for RS, HEX, CCD and CRC instructions. When using the 16-bit mode, set M8161 to normally
OFF. M8161 is cleared when the PLC mode is changed from RUN to STOP.
Operation
In the following program, conversion is executed as follows:
Devices after 
D100 = 0ABCH
D101 = 1234H
D102 = 5678H
Number of specified digits (characters) and conversion result
Bit configuration in the case of "n = K4"
• When outputting data in the BCD format for a printer, for example, it is necessary to convert binary data into BCD 
data before executing this instruction.
n
K1
K2
K3
K4
K5
K6
K7
K8
K9
Low-order 8 bits of D200
[C]
[B]
[A]
[0]
[4]
[3]
[2]
[1]
[8]
High-order 8 bits of D200
[C]
[B]
[A]
[0]
[4]
[3]
[2]
[1]
Low-order 8 bits of D201
[C]
[B]
[A]
[0]
[4]
[3]
[2]
High-order 8 bits of D201
[C]
[B]
[A]
[0]
[4]
[3]
Low-order 8 bits of D202
[C]
[B]
[A]
[0]
[4]
High-order 8 bits of D202
[C]
[B]
[A]
[0]
Low-order 8 bits of D203
Does not change
[C]
[B]
[A]
High-order 8 bits of D203
[C]
[B]
Low-order 8 bits of D204
[C]
   
S
   
D
   
D
M8161
M8000
FNC 82
ASCI
n
Command
input
16-bit mode
M8161
M8000
FNC 82
ASCI
D100
D200
K4
X010
16-bit mode
   
S
  D
0
0
0
0
1
1
0
0
1
0
0
0
0
0
1
0
0
1
0
0
0
0
1
0
1
1
0
0
0
0
1
0
0
0
1
1
1
1
0
1
0
1
0
1
0
0
0
0
D 100 = 0ABCH
0
A
B
C
D 200
[A] 
→ 41H
[0] 
→ 30H
D 201
[C] 
→ 43H
[B] 
→ 42H
ASCII code
[0] = 30H [1] = 31H [5] = 35H
[A] = 41H [2] = 32H [6] = 36H
[B] = 42H [3] = 33H [7] = 37H
[C] = 43H [4] = 34H [8] = 38H