Example - Ladder Diagram
SUB
The SUB instruction subtracts a WORD value, S2, from a WORD value, S1, and saves the difference in an assigned WORD data register, D.
Ladder Diagram Example
When M0.1 is powered ON, the WORD data register, D2, is subtracted from the WORD data register, D1, and the difference is saved in the WORD data register, D5.
Memory Monitor
![]()
SUBP
The SUBP one-shot instruction subtracts a word value, S2, from a WORD value, S1, and saves the difference in an assigned WORD data register, D.
Every time this instruction executes, it energizes the output only once.
Ladder Diagram Example
When M0.1 is powered ON, the WORD data register, D2, is subtracted from the WORD data register, D1, and the difference is saved in the WORD data register, D5.
Memory Monitor
![]()