Skip to main content

Example - Ladder Diagram

ENCO​


The ENCO instruction encodes 2n bits starting at the value S and saves the location value of the most significant bit set in an assigned WORD data register, D.

Ladder Diagram Example​


When the contact, M0.0 is ON (1), the instruction encodes 25 bits of the data register, D10, and stores the result in D13.


Memory Monitor​

ENCOP​


The ENCOP one-shot instruction encodes 2n bits starting at the value S and saves the location value of the most significant bit set in an assigned WORD data register, D.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example​


When the contact, M0.1 is ON (1), the instruction encodes 25 bits of the data register, D15, and stores the result in D18.


Memory Monitor​