Skip to main content

Example - Ladder Diagram

TEST


The TEST instruction reads a BOOL value from the WORD data register, S1, at the bit number, S2, and saves the result in an assigned BOOL data register, D.

Ladder Diagram Example


When the contact, M0.0, is powered ON (1), the TEST instruction examines the 5th bit of the data register, D0.



Since bit 5 is 1, the result BOOL data register, D2.0, is set to 1.

Memory Monitor

TESTP


The TESTP one-shot instruction reads a BOOL value from the WORD data register, S1, at the bit number, S2, and saves the result in an assigned BOOL data register, D.
Every time this instruction executes, it energizes the output only once.

Ladder Diagram Example


When the contact, M0.5, is powered ON (1), the TESTP instruction examines the 10th bit of the data register, D10.



Since bit 10 is 0, the result BOOL data register, D12.0, is set to 0.

Memory Monitor