Skip to main content

Example - Ladder Diagram

DSUM


The DSUM instruction counts the set bits, the bits equal to 1, of the DWORD value, S, and saves the amount of set bits in an assigned DWORD data register, D.

Ladder Diagram Example


When the contact, M2.2 is ON (1), the instruction counts the set bits, all bits equal to 1, of the DWORD data register, D10.
The result of the sum is saved in D13.


Memory Monitor

DSUMP


The DSUMP one-shot instruction counts the set bits, the bits equal to 1, of the DWORD value, S, and saves the amount of set bits in an assigned DWORD data register, D.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example


When the contact, M2.3 is ON (1), the instruction counts the set bits, all bits equal to 1, of the DWORD data register, D15.
The result of the sum is saved in D18.


Memory Monitor