High
−
level Instructions
3
−
181
Explanation of example
Converts the 32-bit data stored in data registers DT1 and DT0 to ASCII code that expresses the equivalent
decimals when trigger R0 turns on. The converted data is stored in data registers DT54 to DT50 (10 bytes).
· ··
·
Decimal
Bit position
·
· ·
· ·
15
1211
8 7
4 3
0
DT1
ASCII HEX code
ASCII character
3
8
8
3
7
7
3
6
6
3
5
5
DT54
DT53
Number of bytes specified by S2 (10 bytes)
Source
Destination
· ··
· ·
· ·
· ·
15
1211
8 7
4 3
0
DT0
3
4
4
3
3
3
3
2
2
3
1
1
DT52
DT51
2
2
0
DT50
SPACE
0
K12345678
Description
Converts the 32-bit data specified by S1 to ASCII code that expresses the equivalent decimals. The
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.
Precautions during programming
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: H2D).
If the area specified by S2 is more than that required by the converted data, the ASCII code for “SPACE”
(ASCII HEX code: H20) 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.
Flag conditions
Σ
Error flag (R9007):
Turns on and stays on when:
Σ
Error flag (R9008):
Turns on for an instant when:
−
The area specified using the index modifier exceeds the limit.
−
The number of bytes specified by S2 exceeds the area specified by D.
−
The data specified by S2 is recognized as “0”.
−
The converted result exceeds the area specified by D.
−
The number of bytes of converted result exceeds the number of bytes
specified by S2.
−
For FP2SH and FP10SH, the error flag (R9007) turns on only when these
operation errors occurs.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]
Summary of Contents for FP-X
Page 1: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 2: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 24: ...Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...
Page 1333: ...5 245 Phone 800 894 0412 Fax 888 723 4773 Web www clrwtr com Email info clrwtr com ...