Skip to main content

Example - Ladder Diagram

NEG


The NEG instruction negates a WORD value, D, and saves the result in the same assigned WORD data register, D.

Ladder Diagram Example


When the contact, M2.5, is powered ON (1), the value of the data register, D60, 12,345, is negated.
The value of the negation, -12,345, is saved in the same data register, D60.


Memory Monitor

NEGP


The NEGP one-shot instruction negates a WORD value, D, and saves the result in the same assigned WORD data register, D.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example


When the contact, M2.7, is powered ON (1), the value of the data register, D65, -32,767, is negated.
The value of the negation, 32,767, is saved in the same data register, D65.


Memory Monitor