671
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-FN
C
169
R
eal
Ti
m
e
C
loc
k
C
ont
ro
l
22
FN
C
170
-F
N
C
17
9
E
xt
e
rnal
D
evi
ce
23
FN
C
180
Su
b
st.
I
n
str
. I
n
fo
24
FN
C
181-FN
C
189
O
ther
s
25
FN
C
190-FN
C
19
9
B
loc
k D
a
ta
O
per
at
io
n
26
FN
C
200-FN
C
209
C
har
act
e
r St
ring
C
ont
ro
l
27
F
N
C2
10
-F
NC
21
9
Da
ta
O
per
at
ion 3
28
FN
C
220-FN
C
24
9
Da
ta
Co
m
p
a
ris
o
n
29
FN
C
250-FN
C
269
Da
ta
T
a
b
le
O
per
at
io
n
30
FN
C
27
0-F
N
C
274
Ex
-D
ev
ic
e
In
ve
rte
r C
o
mm
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.
ESTR(FNC116)
Converts binary floating point data into a character string (ASCII codes) of specified number of
digits.
EVAL(FNC117)
Converts a character string (ASCII codes) into binary floating point 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