Skip to main content

Example - Ladder Diagram

DTEST


The DTEST instruction reads a BOOL value from the DWORD 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, M1.0, is powered ON (1), the DTEST instruction examines the 21st bit of the data register, D30 and D31.



Since bit 21 is 1, the result BOOL data register, D33.0, is set to 1.

Memory Monitor

DTESTP


The DTESTP one-shot instruction reads a BOOL value from the DWORD 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, M2.0, is powered ON (1), the DTEST instruction examines the 30th bit of the data register, D40 and D41.



Since bit 30 is 0, the result BOOL data register, D43.0, is set to 0.

Memory Monitor