Delta DVP-ES2 User Manual
Page 188
D V P - E S 2 / S A 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g
3 - 7 2
API Mnemonic Operands
Function
18
D BCD P
Convert BIN to BCD
Controllers
ES2/EX2 SS2
SA2
SE
SX2
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H
KnX
KnY KnM KnS T C D E F
S
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
*
*
BCD, BCDP: 5 steps
DBCD, DBCDP: 9 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2
Operands:
S: Source of data D: Conversion result
Explanations:
1.
The content in S (BIN value) is converted into BCD value and stored in D
2.
As a 16-bit (32-bit) instruction, when the conversion result exceeds the range of 0 ~ 9,999 (0
~ 99,999,999), and M1067, M1068 = ON, D1067 will record the error code 0E18 (hex)
3. If
operand
S and D use index register F, only 16-bit instruction is available.
4.
Flags: M1067 (Program execution error), M1068 (Execution error locked), D1067 (error
code)
Program example:
1.
When X0 = ON, the binary value of D10 will be converted into BCD value, and the 1s digit of
the conversion result will be stored in K1Y0 (Y0 ~ Y3, the 4 bit devices).
BCD
D10
K1Y0
X0
2.
If D10=001E (Hex) = 0030 (decimal), the result will be Y0~Y3 = 0000(BIN).