Binary-To-Bcd: Bcd(101) - Omron SYSMAC CVM1 Series Operation Manual

Duplex system
Hide thumbs Also See for SYSMAC CVM1 Series:
Table of Contents

Advertisement

Conversion Instructions

5-17-2 BINARY-TO-BCD: BCD(101)

Ladder Symbol
(101)
BCD
Variations
j BCD(101)
Description
Precautions
Flags
Example
0000
06
208
The bit contents of words D00010 and D00011 after execution are:
S
R
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.
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.
Content of *DM word is not BCD when set for BCD.
ER (A50003):
Content of S exceeds 270F.
EQ (A50006):
0 has been placed in R
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.
(101)
BCD
D00150 D00160
4
0
D00010
0 1 0 0 0 0 0 0 1 0 0 1 0 1 0 1
0
F
D00011
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
Operand Data Areas
S: Source word
CIO, G, A, T, C, DM, DR, IR
R: Result word
CIO, G, A, DM, DR, IR
Binary
BCD
Section 5-17
9
5
F
F
S
R
Address Instruction
00000
LD
00001
BCD(101)
Operands
000006
D00150
D00160

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cv seriesSysmac cvm1d series

Table of Contents