EasyManua.ls Logo

FATEK FBs-CB2 - Page 162

FATEK FBs-CB2
348 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Basic Function Instruction
6-37
FUN 20 D P
BCD
BIN TO BCD CONVERSION
(Converts BIN data of the device specified at S into BCD and stores the result in D)
FUN 20 D P
BCD
Operand
S : The register to be converted
D : The register to store the converted data
(BCD code)
The S, D may combine with V, Z, P0~P9 to serve
indirect addressing
WX WY WM WS TMR CTR HR IR OR HR HSCR RTCR SR ROR DR K
Range
Ope-
rand
WX0
WX240
WY0
WY240
WM0
WM1896
WS0
WS984
T0
T255
C0
C255
R0
R3839
R3804
R3903
R3940
R3919
R3920
R4047
R4096
R4127
R4128
R4135
R4136
R4167
R5000
R8071
D0
D4095
16/32 bit
+/- number
S
D * *
FB-PLC uses binary code to store and to execute calculations. If want to send the internal PLC data to the
external displays such as seven-segment displays, it is more convenient for us to read the result on screen
by converting the BIN data to BCD data. For example, it is more clear for us to read the reading "12"
instead of the binary code "1100."
Converts BIN data of the device specified at S into BCD and writes the result in D when the operation
control input "EN" =1 or "EN" ( P instruction) from 0 to 1. If the data in S is not a BCD value (0~9999 or
0~9999999), then the error flag FO0 is set to 1 and the old data of D are retained.
Example 16-bit BIN to BCD conversion
Ladder diagram Key operations Mnemonic code
S :
D :
R
9999
20. BCD
EN
X0
ERR
0
ORG
ORG X 0
FUN 20
S : 9999
D : R 0
B15 B0
S
K
0 010011100001111
Ø
X01
B15 B0
D
R0 1 001100110011001

Other manuals for FATEK FBs-CB2

Related product manuals