Conversion instructions
644
Part III FP Instructions
F78_DA2BIN
ASCII -> 32 bit BIN conversion
The ASCII codes being converted should be stored in the direction of the last
address in the specified area.
If the area specified by s1 and s2 is more than that required by the data you want
to convert, place "0" (ASCII HEX code: 16#30) or "SPACE" (ASCII HEX code:
16#20) in the extra bytes.
ASCII codes with signs (such as +: 16#2B and -: 16#2D) are also converted. The
+ codes can be omitted.
Example of converting an ASCII code indicating a negative number
35 2D
s[2] s1[1] s1[0]
31
1–
3233
32
20
s1[3]
34
54
s1[4]
3637
76
38
8
d
-12345678
B29E43FF
ASCII code
Code Extra byte
Range specified by s2 (10 bytes)
F78_DA2BIN instruction execution
Converted result
(Space)
ASCII HEX code to express decimal characters:
ASCII HEX
code
Decimal
characters
16#20
16#2B
16#2D
16#30
16#31
16#32
16#33
16#34
16#35
16#36
16#37
16#38
16#39
SPACE
+
-
0
1
2
3
4
5
6
7
8
9
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
Description
Converts ASCII code that expresses the decimal digits, starting from the 16-bit area specified by s1
to 32-bit data as specified by s2. The converted result is stored in the area starting from the 32-bit
area specified by d. s2 specifies the number of bytes used to express the destination data using
decimals.