Panasonic FP Series Programming Manual page 636

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F75_BIN2A
Converts the 16-bit data specified by s1 to ASCII codes that express the equivalent decimal value.
Description
The converted result is stored in the area starting from the 16-bit area specified by d as specified
by s2. Specify the number of bytes in decimal number in s2. (This specification cannot be made
with BCD data.)
If 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 towards the final address, so the position of the
ASCII code may change, depending on the size of the data storage area.
When s2 = 8 (8 bytes)
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.
The following illustrations show conversions from 16-bit decimal data to ASCII codes.
When a negative number is converted:
16-bit data
Converted
result
30
0
Range specified by s2 (6 bytes)
16-bit BIN -> ASCII conversion
d[3]
d[2]
d[1]
30
30
31
2D
20
20
0
0
1
(Space) (Space)
ASCII code
Extra bytes
Range specified by s2
s1
FF
9C
–100
F75_BIN2A instruction execution
d[2]
d[1]
d[0]
30
31
2D
20
20
0
1
(Space)
(Space)
ASCII code
Extra bytes
d[0]
20
20
(Space)
(Space)
Conversion instructions
635

Advertisement

Table of Contents
loading

Table of Contents