Mitsubishi Electronics Mitsubishi Digital Electronics Video Gaming Accessories FX3G ユーザーズマニュアル

ページ / 936
675
FX
3G
/FX
3U
/FX
3UC
 Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
29 Data Table Operation – FNC250 to FNC269
29.5 FNC260 – DABIN / Decimal ASCII to BIN Conversion
21
FN
C
160
-F
N
C
16
9
R
eal
 T
im
e C
lock
 
C
ont
ro
l
22
FN
C
170-
FN
C
179
E
xte
rnal D
evice
23
FN
C
180
A
lter
nate 
In
st
ru
ct
ions
24
FN
C
181-
FN
C
18
9
O
ther
s
25
FN
C
190-
FN
C
199
B
lock D
ata
 
O
per
ation
26
FN
C2
00
-F
NC
20
9
C
ha
racter
 S
tring 
Co
ntro
l
27
FN
C
210-
FN
C
21
9
Da
ta
 
O
per
ati
on 3
28
FN
C
220-
FN
C
249
Da
ta
 
C
om
par
ison
29
FN
C
25
0-F
N
C
269
D
ata T
abl
O
per
at
ion
30
FN
C
270-
FN
C
274
Ex-
D
ev
ice 
Inv
ert
er
 Com
m
s
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 within the range 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
S ‚
D ‚
+0
b15
+2
b8 b7
b0
S ‚
+1
High-order 16 bits
b16
b31
32-bit data
+3
+5
+4
Low-order 16 bits
b0
b15
D ‚
+1
D ‚
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
S ‚
+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
D ‚
-1234543210
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S
   
S