675
FX3G/FX3U/FX3UC 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
FNC160-FNC169
Real Time Clock
Control
22
FNC170-FNC179
External Device
23
FNC180
Alternate
Instructions
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
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
b16b31
32-bit data
+3
+5
+4
Low-order 16 bits
b0b15
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