Mitsubishi Electronics FX3G User Manual

Page of 964
675
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
29 Data Table Operation – FNC250 to FNC269
29.5 FNC260 – DABIN / Decimal ASCII to BIN Conversion
21
FNC160
-F
NC1
69
R
eal
 T
ime C
lock
 
C
ontrol
22
FNC17
0-F
NC
179
E
xternal D
evice
23
FNC
180
Alternate 
Instructions
24
FN
C181-
FNC18
9
O
thers
25
FNC190
-F
NC1
99
Bl
oc
k D
ata
 
Op
er
ation
26
FNC20
0-F
NC209
C
har
ac
te
r S
trin
Con
tro
l
27
FNC2
10-
FNC21
9
Dat
Operati
on 3
28
FNC220
-F
NC2
49
Da
ta 
C
omp
ari
son
29
FNC25
0-F
N
C
269
D
ata T
abl
Operation
30
FNC2
70-
FNC276
Ex
-Dev
ice
2. 32-bit operation (DDABIN and DDABINP)
1) Data stored in 
 to 
+5 expressed in decimal ASCII codes (30H to 39H) is converted into 32-bit binary
data, and stored in [
+1, 
].
For example, when 
 to 
+5 store ASCII codes expressing "-1,234,543,210", 32-bit binary data is
stored in [
+1, 
] as follows:
2) The numeric range of data stored in 
 to 
+5 is from -2,147,483,648 to +2,147,483,647.
The high-order byte of 
+5 is ignored.
3) As "sign data" (low-order byte of 
), "20H (space)" is set when the data to be converted is positive, and "2DH
(-)" is set when the data to be converted is negative.
4) An ASCII code for each digit is ranging from "30H" to "39H".
5) When an ASCII code for each digit is "20H (space)" or "00H (NULL)", it is handled as "30H".
Related instructions
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is stored in
D8067.
• When the sign data stored in 
 is any value other than "20H (space)" or "2DH (-)" (error code: K6706)
• When an ASCII code for each digit stored in 
 to 
+2(5) is any value other than "30H" to "39H", "20H 
(space)", or "00H (NULL)" (error code: K6706)
• When the numeric range of 
 to 
+2(5) is outside the following range (error code: K6706)
• When 
 to 
+2(5) exceeds the device range (error code: K6706)
Instruction
Description
ASCI (FNC 82)
Converts hexadecimal codes into ASCII codes.
HEX (FNC 83)
Converts ASCII codes into hexadecimal codes.
STR (FNC200)
Converts binary data into a character string (ASCII codes).
VAL (FNC201)
Converts a character string (ASCII codes) into binary data.
BINDA (FNC261)
Converts binary data into decimal ASCII codes (30H to 39H).
Setting range
16-bit operation
−32768 to 32767
32-bit operation
−2,147,483,648 to 2,147,483,647
   
S
   
S
   
D
   
D
Command
input
FNC260
DDABINP
+0
b15
+2
b8 b7
b0
+1
High-order 16 bits
b16
b31
32-bit data
+3
+5
+4
Low-order 16 bits
b0
b15
+1
ASCII code for 100,000's digit
ASCII code for 1,000,000's digit
ASCII code for 1,000,000,000's digit
ASCII code for 10,000,000's digit
Sign data
ASCII code for 100,000,000's digit
(Ignored)
ASCII code for 1's digit
ASCII code for 1000's digit
ASCII code for 10's digit
ASCII code for 10000's digit
ASCII code for 100's digit
   
S
   
S
   
D
   
D
+0
b15
+2
b8 b7
b0
+1
+3
+5
+4
35H(5)
34H(4)
31H(1)
33H(3)
2DH(-)
32H(2)
(Ignored)
30H(0)
33H(3)
31H(1)
34H(4)
32H(2)
D  +1
-1234543210
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S