Download Omron C200HS User's Manual

Transcript
Section 5-18
Data Conversion
Signed Binary Data
BCD(24) cannot be used to convert signed binary data directly to BCD. To convert signed binary data, first determine whether the data is positive or negative. If
it is positive, BCD(24) can be used to convert the data to BCD. If it is negative,
use the 2’s COMPLEMENT – NEG(––) instruction to convert the data to unsigned binary before executing BCD(24). Refer to page 29 for details on signed
binary data.
Flags
ER:
S is greater than 270F.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is zero.
5-18-4 DOUBLE BINARY-TO-DOUBLE BCD – BCDL(59)
Ladder Symbols
Operand Data Areas
S: First source word (binary)
BCDL(59)
@BCDL(59)
S
S
R
R
IR, SR, AR, DM, HR, TC, LR
R: First result word
Limitations
IR, SR, AR, DM, HR, LR
If the content of S exceeds 05F5E0FF, the converted result would exceed
99999999 and BCDL(59) will not be executed. When the instruction is not executed, the content of R and R+1 remain unchanged.
S and S+1 must be in the same data area as must R and R+1.
Description
BCDL(59) converts the 32-bit binary content of S and S+1 into eight digits of
BCD data, and outputs the converted data to R and R+1.
Binary
S+1
S
BCD
R+1
R
Signed Binary Data
BCD(24) cannot be used to convert signed binary data directly to BCD. To convert signed binary data, first determine whether the data is positive or negative. If
it is positive, BCD(24) can be used to convert the data to BCD. If it is negative,
use the DOUBLE 2’s COMPLEMENT – NEGL(––) instruction to convert the data
to unsigned binary before executing BCD(24). Refer to page 29 for details on
signed binary data.
Flags
ER:
Content of R and R+1 exceeds 99999999.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
182
ON when the result is zero.