Example - Ladder Diagram
BDIV
The BDIV instruction divides a 4-digit binary coded decimal (BCD) dividend value, S1, by a 4-digit binary coded decimal (BCD) divisor value, S2, and saves the result in an assigned 8-digit binary coded decimal (BCD) data register, D. The quotient is saved in the data register, D ~ D+1, and the remainder is saved in the data register, D+2 ~ D+3.
Ladder Diagram Example
When the contact, M0.0, is powered ON, the 4-digit binary-coded decimal data register, D16, is divided by the 4-digit binary-coded decimal data register, D18, and the result is saved in the 8-digit binary-coded decimal data register, D20.
The quotient is saved in the data register, D20, and the remainder is saved in the data register, D21.
Memory Monitor
![]()
BDIVP
The BDIVP one-shot instruction divides a 4-digit binary coded decimal (BCD) dividend value, S1, by a 4-digit binary coded decimal (BCD) divisor value, S2, and saves the result in an assigned 8-digit binary coded decimal (BCD) data register, D. The quotient is saved in the data register, D ~ D+1, and the remainder is saved in the data register, D+2 ~ D+3.
Every time this instruction executes, it energizes the output only once.
Ladder Diagram Example
When the contact, M0.0, is powered ON, the 4-digit binary-coded decimal data register, D16, is divided by the 4-digit binary-coded decimal data register, D18, and the result is saved in the 8-digit binary-coded decimal data register, D20.
The quotient is saved in the data register, D20, and the remainder is saved in the data register, D21.
memory Monitor
![]()