Redundant instruction
This is a redundant instruction. It is replaced by: FP_ASCII_TO_BCD
Converts the ASCII codes that express the decimal characters starting from the 16-bit area specified by s1 to BCD if the trigger EN is in the ON-state. s2 specifies the number of source data bytes and the direction of converted code source data.
Input
starting 16-bit area for storing ASCII code (source)
specifies number of source data bytes to be converted, and how it is arranged
Output
starting 16-bit area for storing converted result (destination)
Instead of using this F instruction, we recommend using the corresponding FP7 instruction: FP_ASCII_TO_BCD
Specifying s2_Number (direction and number)
Four characters are converted as one segment of data:
The converted result is stored in byte units in the area starting from the 16-bit area specified by d. ASCII code requires 8 bits (1 byte) to express 1 BCD character. Upon conversion to a BCD number, the data length will thus be half the length of the ASCII code source data.
If an odd number of characters is being converted, "0" will be entered for bit position 0 to 3 of the final data (byte) of the converted results if data is sequenced in the normal direction, and "0" will be entered for bit position 4 to 7 if data is being sequenced in the reverse direction:
ASCII HEX code to express BCD character:
BCD character |
ASCII HEX code |
---|---|
0 1 2 3 4 5 6 7 8 9 |
H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 |
if ASCII code not corresponding to decimal numbers (0 to 9) is specified.
if the number of bytes specified by s2_Number exceeds the area specified by s1_Start.
if the converted result exceeds the area specified by d_Start.
if the data specified by s2_Number is recognized as "0".
if the number of bytes for ASCII characters in s2_Number is more than 16#8.
if ASCII code not corresponding to decimal numbers (0 to 9) is specified.
if the number of bytes specified by s2_Number exceeds the area specified by s1_Start.
if the converted result exceeds the area specified by d_Start.
if the data specified by s2_Number is recognized as "0".
if the number of bytes for ASCII characters in s2_Number is more than 16#8.