Skip to main content

Example - Ladder Diagram

BSUB


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

Ladder Diagram Example


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


Memory Monitor

BSUBP Example


The BSUBP one-shot instruction subtracts a 4-digit binary-coded decimal (BCD) value, S2, from a 4-digit binary-coded decimal (BCD) value, S1, and saves the difference in an assigned 4-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 4-digit binary-coded decimal (BCD) data register, D4, is subtracted from the 4-digit binary-coded decimal (BCD) data register, D1, and the difference is saved in the 4-digit binary-coded decimal (BCD) data register, D7.


Memory Monitor