(Fun20) - FATEK FBS Series Manual

Plc
Hide thumbs Also See for FBS Series:
Table of Contents

Advertisement

FUN 20
D P
(Converts BIN data of the device specified at S into BCD and stores the result in D)
→BCD
WX
WY
Range
WX0
WY0
Ope-
rand
WX240
WY240
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↑" (
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
X0
EN
BIN TO BCD CONVERSION
WM
WS
TMR CTR
WM0
WS0
T0
C0
WM1896
WS984
T255
C255
P
instruction) from 0 to 1. If the data in S is not a BCD value (0~9999 or
20.
BCD
S :
9999
ERR
0
D :
R
B15
K
S
0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
B15
D
R0
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
S : The register to be converted
D : The register to store the converted data
The S, D may combine with V, Z, P0~P9 to serve
indirect addressing
HR
IR
OR
HR HSCR RTCR SR
R0
R3804
R3940
R3920
R3839
R3903
R3919
R4047
Key operations
ORG
X0=1
6 - 3 7
Basic Function Instruction
Operand
(BCD code)
ROR
R4096
R4128
R4136
R5000
R4127
R4135
R4167
R8071
○ *
○ *
Mnemonic code
ORG
FUN
S : 9999
D : R
B0
B0
FUN 20
D P
→BCD
DR
K
D0
16/32 bit
+/- number
D4095
X
0
20
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents