Panasonic FP Series Programming Manual page 632

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F74_A2BCD
Converts the ASCII codes that express the decimal characters starting from the 16-bit area
Description
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.
s2 = 16#
0 0
2
Four characters are converted as one segment of data:
Normal direction
2
1
4
1 2
3 4
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 code
ASCII HEX
code
character
This position is
filled with "0"
Converted result
BCD HEX code
ASCII HEX code to express BCD character:
ASCII -> BCD conversion
Number of bytes for ASCII characters
1
1: 1 byte (1 ASCII character)
2: 2 bytes (2 ASCII characters)
3: 3 bytes (3 ASCII characters)
4: 4 bytes (4 ASCII characters)
5: 5 bytes (5 ASCII characters)
6: 6 bytes (6 ASCII characters)
7: 7 bytes (7 ASCII characters)
8: 8 bytes (8 ASCII characters)
Direction of converted data
0: Normal direction
1: Reverse direction
Reverse direction
ASCII
3
4
3
code
BCD data
1 2
3 4
s1[3]
s1[2]
s1[1]
37
36
35
34
7
6
5
4
7 ASCII characters (7 bytes)
F74_A2BCD instruction execution
d[1]
d[0]
01
23
45
2
1
s1[0]
33
32
31
3
2
1
67
Conversion instructions
631

Advertisement

Table of Contents
loading

Table of Contents