Skip to main content

Example - Ladder Diagram

DBSUB


The DBSUB instruction subtracts an 8-digit binary-coded decimal (BCD) value, S2, from an 8-digit binary-coded decimal (BCD) value, S1, and saves the difference in an assigned 8-digit binary-coded decimal (BCD) data register, D.

Ladder Diagram Example


When M0.1 is powered ON, the 8-digit binary-coded decimal (BCD) data register, D4, is subtracted from the 8-digit binary-coded decimal (BCD) data register, D2, and the difference is saved in the 8-digit binary-coded decimal (BCD) data register, D6.


Memory Monitor

DBSUBP


The DBSUBP one-shot instruction subtracts an 8-digit binary-coded decimal (BCD) value, S2, from an 8-digit binary-coded decimal (BCD) value, S1, and saves the difference in an assigned 8-digit binary-coded decimal (BCD) data register, D.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example


When M0.1 is powered ON, the 8-digit binary-coded decimal (BCD) data register, D4, is subtracted from the 8-digit binary-coded decimal (BCD) data register, D2, and the difference is saved in the 8-digit binary-coded decimal (BCD) data register, D6.


Memory Monitor