5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-35
API
W
W
Applicable model
20PM
19
D
D
BIN
P
P
Converting a binary-coded decimal value
into a binary value
Bit device Word device
X Y M S K H KnX KnY KnM KnS T C D V Z
S
* * * * * * * * *
D
* * * * * * * *
Note: The instruction supports V devices and Z devices. (If the 16-bit
instruction is used, Z devices can not be used. If the 32-bit
instruction is used, V devices can not be used.)
Please refer to specifications for more information about device
ranges.
16-bit instruction (5 steps)
BIN
Continuity
instruction
BINP
Pulse
instruction
32-bit instruction (6 steps)
DBIN
Continuity
instruction
DBINP
Pulse
instruction
Flags
Ox O100
M1793 M1953 Operation error flag
Explanation
The binary-coded decimal value in S is converte
d into a binary value, and the
conversion result is transferred to D.
S: Source; D: Conversion result
The 16-bit binary-coded decimal value in S should be in the range of 0 to 9,999,
and the 32-bit binary-coded decimal value in S should be in the range of 0 to
99,999,999.
Decimal constants and hexadecimal constants are converted into binary values
automatically. Users do not need to use the instruction.
Example
When X0 is ON, the binary-coded decimal value in K1M0 is converted into a
binary value, and the conversion result is stored in D10.
X0
BIN D10K1M0
Additional
remark
Applications of the instructions BCD and BIN:
1. If a DVP-10PM series motion controller wants to read a binary-coded
decimal value created by a DIP switch, users have to use the instruction BIN
to convert the value into a binary value, and store the conversion result in
the DVP-10PM series motion controller.
2. If users want to display a value stored in a DVP-10PM series motion
controller on a seven-segment display on which binary-coded decimal values
can be displayed, they have to use the instruction BCD to convert the value
into a binary-coded decimal value, and transfer the conversion result to the
seven-segment display.
3. When X0 is ON, the binary-coded decimal value in K4M0 is converted into a
binary value, and the conversion result is stored in D100. Subsequently, the
binary value in D100 is converted into a binary-coded decimal value, and the
conversion result is stored in K4Y20.
X0
BIN D100K4X0
BCD D100 K4Y20