Panasonic FP Series Programming Manual page 626

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F72_A2HEX
Converts the ASCII codes that express the hexadecimal characters starting from the 16-bit area
Description
specified by s1 to hexadecimal numbers if the trigger EN is in the ON-state. s2 specifies the
number of ASCII (number of characters) to be converted. The converted result is stored in the area
starting from the 16-bit area specified by d. ASCII code requires 8 bits (one byte) to express one
hexadecimal character. Upon conversion to a hexadecimal number, the data length will thus be half
the length of the ASCII code source data.
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
s1[1]
4
2
4
A
Converted
result
Converted results are stored in byte units. If an odd number of characters is being converted, "0"
will be entered for bits 0 to 3 of the final data (byte) of the converted results. Conversion of odd
number of source data bytes:
ASCII code
s1[3]
This position is filled
with "0"
Converted result
Hexadecimal characters and ASCII codes:
ASCII -> HEX conversion
s1[0]
1
4
4
4
3
B
C
D
d
s1[2]
s1[1]
31
46
45
44
43
42
1
F
E
D
C
B
7 characters (7 bytes)
F72_AHEX instruction execution
d[1]
d[0]
10
EF
CD
AB
s1[0]
41
A
Conversion instructions
625

Advertisement

Table of Contents
loading

Table of Contents