Redundant instruction
This is a redundant instruction. It is replaced by: FP_ASCII_TO_HEX
Converts the ASCII codes that express the hexadecimal characters starting from the 16-bit area 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.
Input
starting 16-bit area for ASCII code (source)
specifies number of source data bytes to be converted
Output
starting 16-bit area for storing converted data (destination)
Instead of using this F instruction, we recommend using the corresponding FP7 instruction: FP_ASCII_TO_HEX
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.
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:
Hexadecimal characters and ASCII codes:
ASCII HEX code |
Hexadecimal number |
---|---|
16#30 16#31 16#32 16#33 16#34 16#35 16#36 16#37 16#38 16#39 16#41 16#42 16#43 16#44 16#45 16#46 |
0 1 2 3 4 5 6 7 8 9 A B C D E F |
if the number of bytes specified by s2 exceeds the area specified by s1.
if the converted result exceeds the area specified by d.
if the data specified by s2 is recognized as "0".
if ASCII code, not a hexadecimal number (0 to F), is specified.
if the number of bytes specified by s2 exceeds the area specified by s1.
if the converted result exceeds the area specified by d.
if the data specified by s2 is recognized as "0".
if ASCII code, not a hexadecimal number (0 to F), is specified.