Panasonic FP Series Programming Manual page 645

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Conversion instructions
F78_DA2BIN
Converts ASCII code that expresses the decimal digits, starting from the 16-bit area specified by s1
Description
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.
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
ASCII code
s1[4]
s1[3]
38
37
36
8
7
6
Range specified by s2 (10 bytes)
Converted result
ASCII HEX code to express decimal characters:
ASCII HEX
code
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
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
644
ASCII -> 32 bit BIN conversion
s[2]
s1[1]
s1[0]
35
34
33
32
31
2D
5
4
3
2
1
Code
F78_DA2BIN instruction execution
d
FF
43
9E
B2
-12345678
Decimal
characters
SPACE
+
-
0
1
2
3
4
5
6
7
8
9
20
(Space)
Extra byte

Advertisement

Table of Contents
loading

Table of Contents