Learn › Instructions
OTE: Output Energize
OTE is the basic coil of ladder logic. It turns its bit on while the rung is true and off while the rung is false, every scan. It's the instruction you'll use most, and it has one rule worth learning early.
How OTE works
OTE, drawn ( ), sits at the right end of a rung. Each scan, when the PLC reaches it:
- If power reaches it (the rung is true), it writes its bit to 1.
- If power doesn't reach it (the rung is false), it writes its bit to 0.
| Start_PB Horn |
|------] [--------------------------------( )----|
Horn back to 0.That second bullet is what makes an OTE different from a latch: it actively turns the bit off when the rung is false. The output follows the rung, no memory involved. If you want an output that stays on after the conditions go away, either seal it in (see the seal-in tutorial) or use OTL and OTU.
The name comes from relays again: "energize the output coil". On a real PLC an OTE often drives a physical output that energizes a motor starter, solenoid or light. It can just as easily write an internal bit that other rungs use as a condition.
Where OTE goes
Outputs live in the last column of a rung. One rung can drive more than one output: put a branch around the outputs, and each one on its branch receives the same rung condition.
| Auto_Run +----( )----|
|------] [--------------------------+ Conveyor |
| +----( )----|
| Run_Light |
In the Playground, select a spot and press 3, or drag OTE from the toolbar. The rung widens as needed so the output always ends up in the last column.
The one-coil rule: write each tag once
Here's the rule: use only one OTE per tag in the whole program. It's not that the PLC refuses two. It will happily solve both. The problem is what happens when it does.
Because outputs are written as the program is solved, top to bottom, two OTEs writing the same tag fight each other every scan, and the lower one always has the final say. Look at this:
| Manual_Run Pump |
0|------] [--------------------------------( )----|
| Auto_Run Pump |
1|------] [--------------------------------( )----|
Pump. Manual never works unless Auto is also on.With Manual_Run on and Auto_Run off, rung 0 writes Pump = 1, then rung 1 immediately writes Pump = 0. At the end of the scan, Pump is off. (Strictly, it's on for the rungs between 0 and 1 during the scan, which can create very confusing bugs if anything in between reads it.)
The fix is to combine the conditions on one rung with a branch, so there is one coil and an OR in front of it:
| Manual_Run Pump |
|------] [------+--------------------------( )----|
| Auto_Run | |
|------] [------+ |
If an output won't turn on even though its rung looks true, search the program for that tag name. Nine times out of ten there's a second coil writing it further down.
Other rungs see the new value right away
An OTE writes its bit immediately. Rungs below it see the new value in the same scan; rungs above see it on the next scan. This is how a ladder program passes decisions down the page: one rung works out an internal bit like Ready_To_Run, and later rungs use XIC Ready_To_Run as a single tidy condition. The scan cycle lesson explains why order matters.
Driving the simulator
In the Playground, simulator outputs are just BOOL tags. Set a conveyor's Forward bit to Motor, and OTE Motor runs the belt. A pop-up transfer has a Raise bit plus its own Forward/Reverse bits. A traffic light has separate red, yellow and green tags, so three OTEs control it. Remember that a conveyor with both Forward and Reverse on stops, so interlock them with an XIO of the opposite direction.
Try it in the Playground
- Open the Playground and add BOOL tags
Manual_Run,Auto_RunandPump. - Build the "wrong" two-rung version above. Run it and toggle
Manual_Runin the tag list:Pumpstays off. - Turn on
Auto_Runtoo, andPumpcomes on, because the last rung now writes 1. - Delete rung 1, add a branch around
XIC Manual_Runon rung 0 and putXIC Auto_Runon it. Now either one runs the pump.
Key points
- OTE writes 1 when its rung is true and 0 when it's false, every scan.
- It has no memory; use a seal-in or OTL/OTU when an output must stay on.
- Write each tag with only one OTE. Combine conditions with branches instead.
- Rungs below an OTE see its new value in the same scan.