Example - Ladder Diagram
DIV
The DIV instruction divides a WORD dividend value, S1, by a WORD divisor value, S2, and saves the result in an assigned DWORD 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 WORD data register, D1, is divided by the WORD data register, D3, and the result saved in the DWORD data register, D5.
The quotient is saved in the data register, D5, and the remainder is saved in the data register D6.
Memory Monitor
![]()
DIVP
The DIVP one-shot instruction divides a WORD dividend value, S1, by a WORD divisor value, S2, and saves the result in an assigned DWORD 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 WORD data register, D1, is divided by the WORD data register, D3, and the result saved in the DWORD data register, D5.
The quotient is saved in the data register, D5, and the remainder is saved in the data register D6.
Memory Monitor
![]()