![background image](http://html1.mh-extra.com/html/omron/cvm1d/cvm1d_operation-manual_742532213.webp)
(101)
BCD
D00150 D00160
0000
06
208
The bit contents of words D00010 and D00011 after execution are:
0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 1
4
0
9
5
D00010
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
0
F
F
F
D00011
5-17-2 BINARY-TO-BCD: BCD(101)
(101)
BCD
S
R
R: Result word
CIO, G, A, DM, DR, IR
S: Source word
CIO, G, A, T, C, DM, DR, IR
Operand Data Areas
Ladder Symbol
Variations
j
BCD(101)
When the execution condition is OFF, BCD(101) is not executed. When the
execution condition is ON, BCD(101) converts the binary (hexadecimal) content
of S into the numerically equivalent BCD digits and outputs the BCD bits to R.
Only the content of R is changed; the content of S is left unchanged.
S
R
BCD
Binary
BCD(101) can be used to convert binary to BCD so that displays on a Program-
ming Device will appear in decimal rather than hexadecimal. It can also be used
to convert to BCD to perform BCD arithmetic operations rather than binary arith-
metic operations, e.g., when BCD and binary values must be added.
If the content of S exceeds 270F, the converted result will exceed 9999,
BCD(101) will not be executed, and the Error Flag (A50003) will be turned ON.
When the instruction is not executed, the content of R remains unchanged.
Note Refer to page 101 for general precautions on operand data areas.
Flags
ER (A50003):
Content of
*
DM word is not BCD when set for BCD.
Content of S exceeds 270F.
EQ (A50006):
0 has been placed in R
Example
When CIO 000006 is ON in the following example, the content of word D00150 is
converted from binary to BCD and stored in D00160. The content of D00150 is
left unchanged.
Address
Instruction
Operands
00000
LD
000006
00001
BCD(101)
D00150
D00160
Description
Precautions
Conversion Instructions
Section 5-17
Summary of Contents for CVM1D
Page 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Page 463: ...iv...
Page 465: ...vi...