Panasonic FP Series Programming Manual page 642

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F77_DBIN2A
Converts the 32-bit data specified by s1 to ASCII code that expresses the equivalent decimals. The
Description
converted result is stored in the area starting from the 16-bit area specified by d as specified by s2.
s2 specifies the number of bytes used to express the destination data using decimal.
When a positive number is converted, the "+" sign is not converted.
When a negative number is converted, the "-" sign is also converted to ASCII
code (ASCII HEX code: 16#2D).
If the area specified by s2 is more than that required by the converted data, the
ASCII code for "SPACE" (ASCII HEX code: 16#20) is stored in the extra area.
Data is stored in the direction of the last address, so the position of the ASCII
code may change depending on the size of the data storage area.
If the number of bytes of ASCII codes following conversion (including the minus
sign) is larger than the number of bytes specified by the s2, an operation error
occurs. Make sure the sign is taken into consideration when specifying the object
of conversion for the s2.
Example of converting a negative number from 32–bit decimal format to ASCII codes
32-bit data
Converted
result
d[4]
38
37
36
8
7
6
Range specified by s2 (10 bytes)
Decimal characters to express ASCII HEX code:
Decimal
characters
SPACE
+
-
0
1
2
3
4
5
6
7
8
9
32-bit BIN -> ASCII conversion
s1
FF
43
9E
B2
–12345678
F77_DBIN2A instruction execution
d[3]
d[2]
d[1]
35
34
33
32
31
5
4
3
2
1
Code
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
d[0]
2D
20
(Space)
Extra byte
Conversion instructions
641

Advertisement

Table of Contents
loading

Table of Contents