Panasonic FP Series Programming Manual page 629

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Conversion instructions
F73_BCD2A
Converts the BCD code starting from the 16-bit area specified by s1 to the ASCII code that
Description
expresses the equivalent decimals according to the contents specified by s2 if the trigger EN is in
the ON-state. s2 specifies the number of source data bytes and the direction of converted data
(normal/reverse).
s2=16#
0 0
2
The two characters that make up one byte are interchanged when stored. Two bytes are converted
as one segment of data:
Normal direction
s1
1 2
3 4
2
1
4
d[1]
The converted result is stored in the area specified by d. ASCII code requires 8 bits (one byte) to
express one BCD character. Upon conversion to ASCII, the data length will thus be twice the
length of the BCD source data.
ASCII HEX code to express BCD character:
BCD character
0
1
2
3
4
5
6
7
8
9
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
628
BCD -> ASCII conversion
1
Number of bytes for BCD data
1: 1 byte (BCD code that expresses a 2-digit decimal)
2: 2 bytes (BCD code that expresses a 4-digit decimal)
3: 3 bytes (BCD code that expresses a 6-digit decimal)
4: 4 bytes (BCD code that expresses a 8-digit decimal)
Direction of converted data
0: Normal direction
1: Reverse direction
Reverse direction
1 2
Converted
3
4
3
result
d[0]
d[1]
ASCII HEX
code
H30
H31
H32
H33
H34
H35
H36
H37
H38
H39
s1
3 4
2
1
d[0]

Advertisement

Table of Contents
loading

Table of Contents