Skip to main content

Example - Ladder Diagram

DBDIV


The DBDIV instruction divides an 8-digit binary coded decimal (BCD) dividend value, S1, by an 8-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, and the remainder is saved in the data register, D+1.

Ladder Diagram Example


When the contact, M0.0, is powered ON, the 8-digit binary-coded decimal data register, D24, is divided by the 8-digit binary-coded decimal data register, D27, and the result is saved in the 8-digit binary-coded decimal data register, D30.
The quotient is saved in the data register, D30, and the remainder is saved in the data register, D31.


Memory Monitor

DBDIVP


The DBDIVP one-shot instruction divides an 8-digit binary coded decimal (BCD) dividend value, S1, by an 8-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, and the remainder is saved in the data register, D+1.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example


When the contact, M0.0, is powered ON, the 8-digit binary-coded decimal data register, D24, is divided by the 8-digit binary-coded decimal data register, D27, and the result is saved in the 8-digit binary-coded decimal data register, D30.
The quotient is saved in the data register, D30, and the remainder is saved in the data register, D31.


Memory Monitor