180
5-18 Data Conversion
The
conversion instructions convert word data
that is in one format into another
format and output the converted data to specified result word(s). Conversions
are
available to convert between binary (hexadecimal) and BCD, to 7-segment
display
data, to ASCII, and between multiplexed and non-multiplexed data. All
of
these
instructions
change only the content of the words to which converted data
is being moved, i.e., the content of source words is the same before and after
execution of any of the conversion instructions.
5-18-1 BCD-TO-BINARY – BIN(23)
S: Source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, SR, AR, DM, HR, LR
Ladder Symbols Operand Data Areas
BIN(23)
S
R
@BIN(23)
S
R
Description When
the execution condition is OFF
, BIN(23) is not executed. When the execu
-
tion
condition is ON, BIN(23) converts the BCD content of S into the numerically
equivalent
binary bits,
and outputs the binary value to R. Only the content of R is
changed; the content of S is left unchanged.
S
R
BCD
Binary
BIN(23)
can be used to convert BCD to binary so that displays on the Program
-
ming Console or any other programming device will appear in hexadecimal
rather than decimal. It can also be used to convert to binary to perform binary
arithmetic operations rather than BCD arithmetic operations, e.g., when BCD
and binary values must be added.
Flags ER: The content of S is not BCD.
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.
Data Conversion Section 5-18