High−level Instructions
3 − 162
Explanation of example
Converts 4 ASCII codes stored in data registers DT0 and DT1 to hexadecimal numbers when trigger R0 turns
on. The converted data is stored in data register DT40.
····
Hexadecimal
Bit position
·····
Binary data
C
1100
D
1101
A
1010
B
1011
15 1211 8 7 4 3 0
DT40
ASCII HEX code
ASCII character
4
D
44
C
3 4
B
24
A
1
DT1 DT0
Description
Converts ASCII code that expresses hexadecimal characters, starting from the 16-bit area specified by S1, to
hexadecimal numbers as specified by S2. The converted result is stored in the area starting from the 16-bit
area specified by D.
The volume of the results (hexadecimal numeric data) is half that of the converted ASCII code.
Precautions during programming
The data for two ASCII code characters is converted to two numeric digits for one word. When this takes
place, the characters of the upper and lower bytes are interchanged.
Four characters are converted as one segment of data.
ASCII code character
ABCD
42414443
Converted
result
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 S1.
− The converted result exceeds the area specified by D.
− The data specified by S2 is recognized as “0”.
− ASCII code, not a hexadecimal number (0 to F), is specified.