124
D320 PLC User's Manual
Word Conversion Instruction Details
Instruction
Mnemonic
BCD Conversion,
Binary Conversion
Range
Bit
■
Word
BCD
DBCD
BIN
DBIN
BCD: Convert binary to BCD
BIN: Convert BCD to binary
■
Double words
Ladder
BCD: Convert the S value from binary into BCD and store in D.
BIN: Convert the S value from BCD into binary and store in D.
Description
1. BCD: Convert S, which is expressed in binary (word /double word), into BCD and store in D.
The range is as follows:
Word conversion:
S = 0 to $270F (hex) = 9999 (decimal)
D = 0 to $9999 (hex) = 39321 (decimal)
Double word conversion:
S = 0 to $05F5E0FF (hex) = 99999999 (decimal)
D = 0 to $99999999 (hex) = 2576980377 (decimal)
2. BIN: Convert S, which is expressed in BCD (word /double word), into binary (binary code)
and store in D. The range is as follows:
Word conversion:
S = 0 to $9999 (hex) = 39321 (decimal)
D = 0 to $270F (hex) = 9999 (decimal)
Double word conversion:
S = 0 to $99999999 (hex) = 2576980377 (decimal)
D = 0 to $05F5E0FF (hex) = 99999999 (decimal)
3. This operation will occur on every scan for which the input condition is true (On). To perform
the operation only on a change of input condition, use the rising/falling edge contact.
Example
Program Expression
Operation Results
Initial conditions:
W0 = $07CC = 1996 (decimal)
W1 = $1996 = 6550 (decimal)
W2 = $XXXX
W3 = $XXXX
Operation results:
W0 = $07CC
W1 = $1996
W2 = $1996 = 6550 (decimal)
W3 = $07CC = 1996 (decimal)
BCD
D =
S =
R
R
BIN
D =
S =
BCD
D = W2
S = W0
BIN
D = W3
N = W1
R0.0
R
Содержание D320 PLC
Страница 1: ...D320 PLC User s Manual...
Страница 18: ...6 D320 PLC User s Manual...
Страница 28: ...16 D320 PLC User s Manual...
Страница 34: ...22 D320 PLC User s Manual...
Страница 78: ...66 D320 PLC User s Manual...
Страница 176: ...164 D320 PLC User s Manual...
Страница 210: ...198 D320 PLC User s Manual...
Страница 258: ...246 D320 PLC User s Manual...