Relay Ladder; Structured Text - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Chapter 2
Bit Instructions (XIC, XIO, OTE, OTL, OTU, ONS, OSR, OSF, OSRI, OSFI)
104
Example:
You typically precede the ONS instruction with an input instruction because you
scan the ONS instruction when it is enabled and when it is disabled for it to
operate correctly. Once the ONS instruction is enabled, the rung-condition-in
must go clear or the storage bit must be cleared for the ONS instruction to be
enabled again.
On any scan for which limit_switch_1 is cleared or storage_1 is set, this rung has
no affect. On any scan for which limit_switch_1 is set and storage_1 is cleared, the
ONS instruction sets storage_1 and the ADD instruction increments sum by 1.
As long as limit_switch_1 stays set, sum stays the same value. The limit_switch_1
must go from cleared to set again for sum to be
incremented again.

Relay Ladder

Structured Text

IF limit_switch_1 AND NOT storage_1 THEN
sum := sum + 1;
END_IF;
storage_1 := limit_switch_1;
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents