Book a consultation

PLC Programming

OTE Instruction (Output Energize): What It Really Writes in a PLC

The OTE instruction writes the rung result into one bit. How it works, why two OTEs on one bit fight, prescan, OTE vs OTL, and 26 vendor editors.

Vladimir Romanov ·


Table of contents13 sections

Every rung you have ever read ends in an instruction like this one. The OTE, Output Energize, is the output coil: the place where a ladder rung’s answer gets written down. Most tutorials describe it as “turns the output on when the rung is true”. That sentence is half the story, and the missing half causes some of the most stubborn bugs in plant programs: duplicate coils that fight each other, HMI buttons that do nothing, and outputs that drop out after a mode change. The OTE writes one bit, every time its rung is solved, whatever the rung says. Once you see it that way, those bugs explain themselves.

This page follows the same pattern as the XIC and XIO pages: it starts with one rung and one motor, and works up to scan order, prescan, how the tag becomes a voltage on a terminal, and how every major vendor writes the same coil. At the end there is a quiz and five harder problems with worked solutions.

The short version. OTE writes the rung condition into one bit: 1 when the rung is true, 0 when it is false, every time the rung is solved. It is not a latch. Give every bit exactly one owner: one OTE, and no other instruction, rung or HMI writing the same bit.

What is the OTE instruction?

The OTE instruction, short for Output Energize, is a ladder logic output instruction that writes one bit. When the rung condition reaching it is true, OTE sets the bit to 1. When the rung condition is false, it clears the bit to 0. Rockwell Automation calls it OTE; most other vendors call it a coil, and Siemens calls it an assignment.

Animation of an enable selector wired to an input, a rung with an XIC on Conveyor_Enable driving an OTE on Conveyor_Run, and a conveyor motor that runs while the selector is on.
Turn the selector on and the rung goes true, so the OTE writes 1 to Conveyor_Run and the conveyor runs. Turn it off and the OTE writes 0 on the next scan. Download the GIF

Rockwell’s Logix 5000 general instructions reference manual (publication 1756-RM003) gives OTE one BOOL operand, the bit to be set or cleared, and this execution table:

Condition when the OTE executesWhat happens to the bitRung condition out
Prescan (when the controller enters Run mode)Cleared to 0False
Rung condition coming in is falseCleared to 0False
Rung condition coming in is trueSet to 1True
PostscanCleared to 0False

Source: Rockwell Automation, Logix 5000 Controllers General Instructions Reference Manual, 1756-RM003, revision P, OTE section.

Three rows out of four write a 0. That is the most important thing on this page. OTE is not “turn on”; it is “make this bit equal to the rung”. The manual also says OTE does not affect the arithmetic status flags and has no fault conditions. There is no OTE in structured text. The manual’s equivalent is a non-retentive assignment, written Conveyor_Run [:=] Conveyor_Enable;, which is cleared in prescan and postscan the way an OTE is. The ordinary := assignment is retentive.

What does the OTE instruction actually write?

OTE writes a bit in controller memory, not a terminal. For a physical output, that bit is an output tag that the I/O system later copies to the module. For everything else, which is most OTEs in a real program, the bit is internal: a permissive, a sequence step, an alarm, or a request that another rung reads.

The operand can be any BOOL. In Logix that includes an output point such as Local:2:O.Data.0, a tag such as Pump_Run, a member of a user-defined type such as Pump101.Run_Cmd, or one bit of a DINT such as Cmd_Word.5. Rockwell’s SLC 500 manual (1747-RM001) lists the files an OTE may address: outputs, inputs, status, bits, timers, counters, control, integers and more. An OTE on an input address is allowed, and it is almost always a mistake, because the input scan overwrites it.

Orange warning beacon light mounted on a bracket above a black work lamp on a white metal frame
A beacon like this is usually one output bit, written by one OTE. When it misbehaves, the first question is which rung owns its bit.

The SLC 500 manual adds behaviour that every OTE user should know: OTE bits are reset when the controller enters or returns to Run or Test mode, when power is restored, and when the OTE sits in a false master control reset (MCR) zone. It also gives a trap specific to subroutines. A bit set by an OTE in a subroutine stays set until that subroutine is scanned again. Stop calling the subroutine and its OTEs freeze at their last value; they do not drop out. That is documented for the SLC 500; in Logix a routine that is not called is not scanned either, so the same applies.

Why do two OTEs on one bit fight? The last rung wins

Every OTE writes its bit when its rung is solved, true or false. Put two OTEs on the same bit and each one overwrites the other on every scan. The one that executes last decides the value the bit ends the scan with, and rungs in between see the first one’s value.

Animation of two rungs that both end in an OTE on Pump_Run, with Auto_Start true and Manual_Start false, showing the bit in memory changing from 1 to 0 within one scan and the pump output staying off.
Rung 0 writes 1 to Pump_Run, then rung 1 writes 0 to the same bit. On a process-image controller the output is updated from memory, which says 0, so the pump stays off. On Logix, an output update that lands between the two rungs can pulse it. Rungs between the two see a 1. Download the GIF

This is the most searched OTE problem, and it comes from treating OTEs as if they ORed together, the way two relay coils on one wire would. They do not. Rockwell does not state “the last one wins” as a rule in the pages we could read; it follows from the execution table, because each OTE writes on every scan. What Rockwell’s SLC 500 manual does say is that using the same address with multiple output instructions is not recommended. Rockwell’s help also describes searching for duplicate destructive bits, which finds OTEs on the same tag; test how your version reports it.

The fix is always the same: one OTE per bit, with every reason to turn the bit on in parallel on its rung.

One OTE owns the bit; every other writer is a bugFive cards. The green card is the single OTE that owns the bit Pump_Run and writes it on every scan. The amber cards are four other writers that fight it: a second OTE on another rung, an OTL or OTU on the same bit, a MOV or COP that writes the word the bit lives in, and an HMI button that writes the tag directly. Whatever they write, the owner rewrites the bit the next time its rung is solved.WHO WRITES PUMP_RUN?The owner: one OTEOTE(Pump_Run)Writes 1 or 0 on every scan.A second OTEThe lower rung wins each scan.Rungs in between see the other value.An OTL or OTU on itThe latch lasts until theOTE rung is next solved.A MOV or COP on its wordWrites all 32 bits at once,including this one.An HMI buttonIts 1 survives one scan at most.Give the HMI its own request bit.The fixPut every condition on theowner's rung, in parallel.
The owner is one OTE. Anything else that writes the same bit fights it, and the owner rewrites the bit the next time its rung is solved.
Writer on the same bitWhat you seeFix
A second OTEThe lower rung wins; rungs between them see the other valueMerge the conditions in parallel on one rung
An OTL or OTUThe latch is undone the next time the OTE rung is solvedPick one: either a latch pair or an OTE, never both
A MOV or COP on the word the bit lives inThe bit flips whenever the move runsKeep command bits out of words that are moved as a block
An HMI or SCADA writeThe button “does nothing”, or flickers for one scanGive the HMI its own request bit and read it with XIC

OTE vs OTL: what is the difference?

OTE writes 1 when its rung is true and 0 when its rung is false. OTL, Output Latch, writes 1 when its rung is true and does nothing when it is false, so its bit stays 1 until something clears it, usually an OTU. Use OTE for anything that should follow its conditions; use a latch only for state that must outlive them.

Animation of two rungs reading Test_PB, one ending in an OTE on Lamp_A and one in an OTL on Lamp_B, with two lamps showing that only the latched one stays on after release.
Two rungs with the same condition. Press the button and both lamps light. Release it and the OTE lamp goes out, while the OTL lamp stays on because a latch does nothing on a false rung. Download the GIF
OTE (Output Energize)OTL (Output Latch)
Rung trueWrites 1Writes 1
Rung falseWrites 0Does nothing
PrescanClears the bit to 0Leaves the bit unchanged
RetentiveNoYes
Needs a partner to clearNoYes, usually OTU
Usual useOutputs and internal bits that follow their conditionsFaults, sequence flags and memory that must outlast their cause

Most experienced programmers prefer an OTE with a seal-in branch over an OTL/OTU pair for anything that drives equipment. The seal-in drops out by itself on a stop, a fault or a mode change; the latch has to be cleared deliberately, and forgetting one is how machines restart on their own. The OTL page covers when a latch is the right choice.

How does an OTE behave over time? It rewrites its bit every scan

Because OTE writes its bit every time its rung is solved, nothing else can change that bit for longer than one scan. That is a feature when the OTE owns the bit, and the explanation for a whole family of “it doesn’t work” reports when something else tries to write it.

Animation of an HMI start button writing 1 into Pump_Cmd, a rung whose OTE owns Pump_Cmd writing 0 back on the next scan, and the bit's value in memory over three scans.
Auto_Mode is off, so the rung is false. An operator presses START PUMP on the HMI, which writes 1 to Pump_Cmd. The next time the rung is solved, the OTE writes 0 again, and the button appears to do nothing. Download the GIF

The HMI case is the one that trips up new programmers and integrators alike. An HMI writes tags over the network, outside the scan. If it writes an OTE’s bit, the value survives only until the OTE runs again, a few milliseconds later. The cure is ownership: the HMI writes a request bit, HMI_Pump_Start_Req, that nothing else writes, and the program reads it with an XIC on the OTE’s rung. The same rule applies to recipe downloads, SCADA writes and other controllers.

When does an OTE write? The scan, prescan and output updates

OTE writes its bit at the moment it executes. What reaches the terminal, and when, depends on the controller’s I/O model. And when the controller enters Run mode, every OTE bit is cleared during prescan before the first real scan.

Animation of a controller mode strip moving from Program through prescan to Run, with an OTE bit cleared during prescan and a latched bit left unchanged, then the OTE rewritten on the first scan.
In Program mode the tags still hold their last values. On the way into Run, prescan solves every rung as false: the OTE writes 0 to Run_Lamp, while the OTL leaves Fault_Mem at 1. The first real scan then writes the OTE according to its rung. Download the GIF

Prescan clears OTE bits

Rockwell’s execution table says prescan clears the OTE bit. That is deliberate: it means no OTE carries a stale 1 into Run. A permissive or an output driven by an OTE starts from 0 and is recalculated on the first scan. Latched bits are different: OTL and OTU do nothing during prescan, so a latched 1 survives the mode change. The SLC 500 manual describes the same reset for OTE bits on entering Run and on power restore.

From the tag to the terminal

Animation of a dosing rung writing the tag Dose_Valve, followed by the output module point and the solenoid valve turning on at the next output update.
The OTE writes 1 to the tag Dose_Valve the moment its rung is true. The output module turns its point on at the next output update, and only then does the dosing valve open. Download the GIF

Writing the tag and switching the terminal are two separate events:

  • Process image controllers. Siemens documents for the S7-1500 that the process image of the outputs is written to the modules at the end of the cycle. The SLC 500 works the same way, with an output scan after the program scan. Every OTE on an output during the scan ends up as the value written at the end, which is why two duplicate coils produce only the last value at the terminal.
  • Logix controllers. ControlLogix and CompactLogix send output data to the modules asynchronously to the program, at each module’s requested packet interval (RPI). An output tag that changes and changes back inside one RPI may never reach the terminal. When an output must change at a precise point in the logic, Logix offers the Immediate Output (IOT) instruction, and the SLC 500 has IOM.

OTE in practice: seven scenarios from simple to advanced

Each scenario shows a rung in a particular state, why OTE is the right instruction, and what goes wrong. Tag names are examples, written the way I would want them in a real program.

1. Packaging: a stack light, one OTE per lamp

A line’s stack light shows green for running, amber for starved and red for faulted. Each lamp is one output, owned by one OTE.

Animation of three rungs driving Green_Light, Amber_Light and Red_Light from Line_Running, Line_Starved and Line_Fault, with a stack light showing the result.
Green is on while the line runs without a fault, amber joins it when the infeed is starved, and a fault turns red on while the XIO on Line_Fault turns green off. Download the GIF

Why OTE: each lamp should follow its condition exactly, on and off, with no memory. What goes wrong: a second rung added years later to “also turn red on for a guard open”. It writes Red_Light with its own OTE, and now red only shows the guard condition, because that rung is lower in the routine. Add the condition to the existing rung instead, in parallel.

2. Packaging: fire the reject gate while a bad pack is at the gate

A checkweigher flags underweight packs, and a tracking bit follows each one down the conveyor. When a flagged pack reaches the reject gate, the gate fires.

Packaging: fire the reject gate while a bad pack is at the gateOne rung. XIC Reject_Tracked and XIC Pack_At_Gate in series drive the coil Reject_Solenoid. In the state shown a pack flagged for rejection has reached the gate, so the solenoid is energised.Reject_TrackedXIC= 1Pack_At_GateXIC= 1Reject_SolenoidOTE14
A pack flagged for rejection has reached the gate, so the OTE energises the reject solenoid for as long as both conditions hold.

Why OTE: the solenoid should be energised only while a flagged pack is at the gate, and drop out the moment it passes. What goes wrong: the pack sits under the gate for only a few scans at line speed. In a Logix controller the output tag can be 1 for less time than the output module’s RPI, so on some configurations the solenoid never fires. Check the input side too: a pulse shorter than the input module’s update interval can be missed before the OTE ever runs. Fixes are a minimum on-time from a timer, an IOT on the output, or a faster RPI, chosen from the actual pack dwell time.

3. Water and wastewater: one OTE per pump, many reasons to call it

A duplex lift station alternates its lead pump. Pump 1 can be called by the level control when it is lead, or by an operator in manual.

Water and wastewater: one OTE per pump, many reasons to call itOne rung. XIC Lead_Is_P1 in series with a parallel branch of XIC Level_Start and XIC Manual_Run_P1, then XIO P1_Fault, driving the coil P1_Call. Every reason to run pump 1 sits on this one rung, so P1_Call has a single owner. In the state shown pump 1 is lead and the level has reached the start point.Lead_Is_P1XIC= 1Level_StartXIC= 1Manual_Run_P1XIC= 0P1_FaultXIO= 0P1_CallOTE6
Every reason to run pump 1 sits on one rung in parallel, so P1_Call has a single owner. Pump 1 is lead and the level has reached the start point.

Why OTE: P1_Call should be true exactly while one of its reasons is true and pump 1 is healthy. What goes wrong: the tempting version has one rung for the lead call and another for manual, both ending in OTE(P1_Call). Manual then works only when the manual rung happens to be lower in the routine, and then the level call stops working: whichever rung is lower wins, so one of them is always dead, and the station’s behaviour depends on rung order nobody remembers. One owner, all reasons in parallel.

4. Food and beverage: a dosing valve, from the tag to the terminal

A flavour dosing valve opens while a dose is requested and the batch is active. The OTE writes the tag; the valve opens at the next output update.

The tag-to-terminal animation above shows this rung. Why OTE: the valve should be open only while the dose is requested; a request removed for any reason must close it. What goes wrong: dosing by counting scans or by an OTE pulse. A dose measured in scans changes with scan time, and a short pulse may never reach the valve on an asynchronous controller. Dose by a flow meter total or a timer, and let the OTE simply hold the valve open while the dose runs.

5. Pharmaceutical: a cleanroom supply fan and its run command

A cleanroom air handler’s supply fan runs while the unit is enabled and nothing has shut it down.

Pharmaceutical: a cleanroom supply fan and its own run commandOne rung. XIC AHU_Enable, XIC Fire_Sys_Normal and XIO Fan_VFD_Fault in series drive the coil Fan_Run_Cmd. In the state shown the air handler is enabled and healthy, so the fan is commanded to run.AHU_EnableXIC= 1Fire_Sys_NormalXIC= 1Fan_VFD_FaultXIO= 0Fan_Run_CmdOTE2
The air handler is enabled and healthy, so the OTE commands the supply fan to run. Any shutdown removes the command on the next scan.

Why OTE: the run command must disappear the moment any permissive is lost, with no memory. What goes wrong: two things. First, the fire shutdown: stopping fans on smoke is a life-safety function, normally hardwired through the fire alarm system. This rung reads the fire system’s normal relay with an XIC, so a broken wire stops the fan, but the PLC only follows the fire system; it does not perform the shutdown. Second, treating Fan_Run_Cmd as proof the fan is running. The OTE writes what the program wants. In a validated system the room’s pressure cascade depends on the fan actually running, so the program also needs run feedback from the drive or an airflow switch, and an alarm when command and feedback disagree.

6. Automotive: two clamp commands merged into one OTE

A welding fixture clamp can be closed automatically by the sequence or manually from a pushbutton. An earlier version had two rungs, each with its own OTE on Clamp_Close.

Automotive: two clamp commands merged into one OTEOne rung. A parallel branch of XIC Auto_Clamp_Req and XIC Manual_Clamp_PB, in series with XIC Part_Present, drives the coil Clamp_Close. This replaces two separate rungs that each had their own OTE on Clamp_Close. In the state shown the clamp is requested by the manual button.Auto_Clamp_ReqXIC= 0Manual_Clamp_PBXIC= 1Part_PresentXIC= 1Clamp_CloseOTE9
Both reasons to close the clamp are now in parallel on one rung, so Clamp_Close has one owner. The manual button is closing the clamp in the state shown.

Why OTE: the clamp should close while either request is present and a part is in the fixture. What goes wrong: with two OTEs, the manual button only worked while the manual rung was lower than the automatic one, and after someone reordered the routine the manual button stopped working entirely. The merged rung also makes the Part_Present condition apply to both requests, which the old automatic rung had and the manual one did not. And a clamp that closes on a button press is a pinch hazard: the closing action needs its own safeguarding in the safety system, such as two-hand control or a light curtain, not just this OTE.

7. Plastics: a heater zone output that drops on any lost permissive

An extruder barrel zone heater is driven by its temperature control output, and must drop out on a failed thermocouple or an overtemperature.

Plastics: a heater zone output that drops on any lost permissiveOne rung. XIC Zone3_Heat_Demand, XIC Barrel_TC_OK and XIO Zone3_Overtemp in series drive the coil Zone3_Heater. In the state shown the thermocouple has failed, so Barrel_TC_OK is 0 and the heater output is off on this scan.Zone3_Heat_DemandXIC= 1Barrel_TC_OKXIC= 0Zone3_OvertempXIO= 0Zone3_HeaterOTE17
The thermocouple has failed, so Barrel_TC_OK is 0 and the heater output is off on this scan.

Why OTE: the heater must turn off the moment any permissive is lost, and turn back on only when all of them return. What goes wrong: the overtemperature limit. A standard OTE that drops the heater is good process control, but the over-temperature protection that prevents a fire belongs to an independent limit controller with its own sensor and contactor. If the PLC’s OTE is the only thing that can turn the heater off, a stuck output or a welded solid-state relay leaves nothing in the way.

What does OTE look like in each vendor’s software?

Every ladder editor has the coil. Rockwell Automation calls it OTE in Studio 5000 Logix Designer and RSLogix 500 (more on those platforms on our Rockwell Automation page). Siemens calls it an assignment; Mitsubishi Electric, CODESYS, Beckhoff and Phoenix Contact call it a coil; AutomationDirect calls it an Out coil. The symbol, a pair of brackets, is the same everywhere.

The same output coil across six programming environmentsA table of six rows. Rockwell Automation calls the instruction OTE, Output Energize, in Studio 5000 Logix Designer and RSLogix 500. Siemens TIA Portal calls it an assignment, Mitsubishi Electric GX Works3 and CODESYS call it a coil, and AutomationDirect CLICK calls it an Out coil. Each row shows the same coil symbol with an example operand and the text form: the Siemens STL equals sign, the Mitsubishi OUT instruction and a structured text assignment.VENDOR AND SOFTWARELADDERTEXT FORMRockwell AutomationStudio 5000 Logix DesignerOTE, Output EnergizePump_RunOTE(Pump_Run)Rockwell AutomationRSLogix 500 (SLC 500, MicroLogix)OTE, Output EnergizeO:2/0OTE O:2/0SiemensTIA Portal (S7-1200, S7-1500)Assignment"Pump_Run"STL: = "Pump_Run"Mitsubishi ElectricGX Works3 (MELSEC iQ-R)CoilY20OUT Y20IEC 61131-3 / CODESYSCODESYS-based softwareCoilbPumpRunST: bPumpRun := expr;AutomationDirectCLICK Programming SoftwareOut coilY001Ladder only
The same output coil in six notations. The symbol is identical; the name, the operand style and the text form change.
VendorSoftwareName of the instructionExample operandText form
Rockwell AutomationStudio 5000 Logix DesignerOTE, Output EnergizePump_Run, Local:2:O.Data.0Rung text OTE(Pump_Run); ST Pump_Run [:=] expr;
Rockwell AutomationRSLogix 500 (SLC 500, MicroLogix)OTE, Output EnergizeO:2/0, B3:1/4OTE O:2/0
SiemensTIA Portal (S7-1200, S7-1500)Assignment"Pump_Run", %Q0.0STL = "Pump_Run" on S7-1500
Mitsubishi ElectricGX Works3 (MELSEC iQ-R)CoilY20, M100OUT Y20
IEC 61131-3 / CODESYS, BeckhoffCODESYS, TwinCAT 3CoilA named BOOL variableST bPumpRun := expr;
Phoenix ContactPLCnext EngineerCoilA named BOOL variableST assignment
AutomationDirectCLICK Programming SoftwareOut coilY001, C10None; ladder only

Sources: Rockwell Automation 1756-RM003 and 1747-RM001; Siemens TIA Portal V20 help (LAD and STL for S7-1500); Mitsubishi Electric SH(NA)-081265ENG; CODESYS and Beckhoff online help; Phoenix Contact PLCnext Engineer help; AutomationDirect CLICK instruction list.

The same OTE in each vendor’s editor

These are real screenshots of the output coil in 26 programming environments, ordered as on the XIC page: the platforms that dominate North American plants first, then the machine-builder platforms, then compact and regional controllers. Each one is framed the same way, with the coil ringed in amber and the source credited under it. Pick a tab to switch software.

VendorSoftwareWhy it is not shown yet
Schneider ElectricEcoStruxure Control Expert (Modicon M340, M580)The manual’s LD chapter shows only drawn symbols, with no editor window. Machine Expert and Machine Expert - Basic are shown above.
KEYENCEKV STUDIOThe manuals sit behind a download form and no public screenshot of the ladder editor turned up.
B&RAutomation StudioNo public screenshot of the LD editor.
InovanceInoProShop, AutoShopThe public manuals have no ladder editor figures.
WAGOe!COCKPITNo public LD screenshot; it is built on CODESYS, shown above.

If you work in one of these, the instruction is the same coil; we will add your editor when we capture it ourselves.

Three differences matter when you switch platforms. Siemens’ assignment writes the result of logic operation (RLO) to its operand and does not change the RLO, so in LAD and FBD several assignments can hang off one network. CODESYS and Beckhoff only allow several coils in one network in parallel. And Mitsubishi Electric’s GX Works3 has a duplicated-coil check; its own FAQ notes that SET and RST on one device are not flagged. If you want a practice environment, I have walked through installing RSLogix 500 for free and TIA Portal.

Why won’t my OTE turn on (or off)? A debugging checklist

When an OTE’s bit or its output is not doing what the rung says, the rung is usually right and something around it is not. Work from the rung out to the terminal.

  1. Check the rung condition at the coil. Online, the coil shows the rung condition reaching it. If the coil is false, debug the inputs, not the output.
  2. Cross-reference the bit. Look for every writer: other OTEs, OTL and OTU, MOV and COP on the containing word, HMI and SCADA tags. More than one writer explains almost every “it turns on and off by itself” report.
  3. Check whether the routine is being scanned. An OTE in a routine that no JSR calls, or in an inhibited task, freezes at its last value.
  4. Check the MCR zone and SFC step. An OTE in a false MCR zone is cleared (Rockwell’s MCR help). In an SFC non-stored action the output is normally cleared when the step ends; confirm it in the SFC manual and check the action qualifier.
  5. Follow the output tag to the module. Confirm the alias points at the right point, the module is not faulted, and its connection is running. A faulted output module holds its outputs in the state its fault configuration says (the Fault Mode setting on the module), not the tag’s value.
  6. Check the output indicator and the field. If the module’s point indicator follows the tag but the device does not move, the problem is outside the controller: the fuse, the wiring, the interposing relay or the device.
  7. Look for forces. A forced output holds its value whatever the OTE writes.
  8. Think about pulse length. On Logix, a tag that is 1 for less than the module’s RPI may never reach the terminal.

Steps 2 and 3 find most problems, and both are much easier in a program with a written standard and version control for PLC code.

Common OTE mistakes

MistakeWhat happensFix
Two OTEs on the same bitThe lower rung wins; behaviour depends on rung orderOne OTE per bit, all conditions in parallel
HMI writes directly to an OTE bitThe button does nothing or works for one scanHMI writes its own request bit; read it with XIC
Expecting OTE to hold its bitThe output drops as soon as the condition goesSeal-in branch, or a latch pair for true memory
OTE and OTL on the same bitThe latch is undone every scan by the OTEChoose one approach for each bit
Reading the command as feedbackThe program trusts what it asked forSeparate feedback input and a discrepancy alarm
OTE in a subroutine that stops being calledThe bit freezes at its last valueClear the bits when the subroutine is skipped, or call it every scan
Standard OTE as the safety outputSafety depends on standard logic and a standard outputSafety relay or safety controller with safety-rated outputs

Test yourself: an interview quiz on OTE

Ten questions, the kind I'd ask in an interview for a controls role to see whether someone really understands OTE. Pick an answer and the explanation appears straight away.

0 of 10 answered

  1. What does an OTE write when its rung is false?

  2. What happens to an OTE bit during prescan, when the controller enters Run?

  3. Rung 5 ends in OTE(Pump_Run) and is true. Rung 30 ends in OTE(Pump_Run) and is false. What value does the Pump_Run tag hold at the end of the scan?

  4. In the same program, what value of Pump_Run does an XIC on rung 20 see?

  5. An HMI writes 1 to a bit that an OTE on a false rung owns. How long does the 1 last?

  6. What is the difference between OTE and OTL when the rung goes false?

  7. A JSR stops calling a subroutine. What happens to an OTE inside it that was writing 1?

  8. On a ControlLogix controller, when does an output terminal change after an OTE writes its tag?

  9. What does Siemens TIA Portal call the OTE equivalent in LAD?

  10. Which is the best fix for two rungs that both end in OTE(Clamp_Close)?

Five harder OTE problems

These are commissioning-grade problems. Try each on paper before opening the solution. The rungs are written in Logix rung text: XIC(tag) and XIO(tag) are contacts, square brackets with commas are parallel branches, and OTE(tag) is the output coil.

Problem 1: the pump that runs in auto but not in hand

A pump has these two rungs. The hand rung is near the top of the routine; the auto rung was added later, 40 rungs below it:

XIC(Hand_Mode) XIC(Hand_Start_PB) OTE(P101_Run);
XIC(Auto_Mode) XIC(Level_High) OTE(P101_Run);

In auto the pump works. In hand, pressing Start does nothing. Explain, then rewrite.

Show the solution

Both rungs own P101_Run. In hand, the hand rung is true and writes 1. Forty rungs later the auto rung runs; it is false because Auto_Mode is 0, and an OTE on a false rung writes 0. The bit ends every scan at 0, so the output never turns on. In auto the problem is invisible, because the auto rung is the last writer and it is the one that matters.

One owner, both modes in parallel:

[XIC(Auto_Mode) XIC(Level_High) ,XIC(Hand_Mode) XIC(Hand_Start_PB) ] XIO(P101_Fault) OTE(P101_Run);

Adding the fault on the shared path also fixes a second bug: in the old version neither rung checked the pump fault. A real pump rung would also seal in the hand start with a stop, and use a high and a low level for auto so the pump does not chatter; they are left out to keep the point.

Problem 2: a reject solenoid that misses packs at high speed

On a ControlLogix line, XIC(Reject_Tracked) XIC(Pack_At_Gate) OTE(Reject_Sol) drives a solenoid on a 1756 output module with an RPI of 20 ms. The continuous task scans in 6 ms. At full line speed a pack sits under the gate sensor for about 15 ms, and roughly one bad pack in ten is not rejected. Explain, and give two fixes.

Show the solution

The OTE writes the output tag correctly for the two or three scans the pack is under the sensor, but Logix sends output data to the module at its RPI, asynchronously to the scan. A 15 ms pulse on a tag that is sent every 20 ms can fall entirely between two updates, so the module never sees it.

Fix one: stretch the command so it is always longer than the update interval, for example with an off-delay timer that holds the solenoid on for 60 ms after the pack is seen, chosen from the gate’s mechanical response. Fix two: reduce the module’s RPI, or add an IOT for the output on the rung so the data is sent immediately. Often both: a defined minimum on-time is good mechanical practice anyway. Then prove it with the line at full speed and a count of rejected versus flagged packs.

Problem 3: the HMI start that only works sometimes

An HMI start button writes 1 to Mixer_Start. The program has XIC(Mixer_Start) XIC(Mixer_Ready) OTE(Mixer_Run) near the top of the routine and, near the end, XIC(Mixer_Run) OTE(Mixer_Start), added “to clear the start request once the mixer is running”. Operators say the button only works sometimes. Explain and fix.

Show the solution

Mixer_Start has two writers: the HMI and an OTE. The OTE writes it on every scan, true or false. While the mixer is stopped, that rung is false, so it writes 0 to Mixer_Start near the end of every scan. The HMI writes over the network, outside the scan, so its 1 lands at a random point in the scan. If it lands after the clear rung and before the mixer rung of the next scan, the mixer rung sees it and the mixer starts. If it lands anywhere else, the clear rung writes 0 over it before the mixer rung ever reads it. The button works when the timing happens to suit it.

Let the HMI own its request bit and let the program own the run bit:

XIC(Mixer_Ready) XIO(Mixer_Stop_Req) [XIC(HMI_Mixer_Start) ,XIC(Mixer_Run) ] OTE(Mixer_Run);

The HMI writes HMI_Mixer_Start as a momentary button and nothing in the program writes it. The seal-in on Mixer_Run keeps the mixer running after the button is released, and losing Mixer_Ready or a stop request drops it. Delete the clear rung: an OTE that writes 0 whenever it is false is not a clear, it is a second owner. And if the HMI button could ever stick at 1, put a one-shot (ONS) on HMI_Mixer_Start so a stuck request cannot restart the mixer by itself when Mixer_Ready returns.

Problem 4: a subroutine output that will not turn off

A packaging machine calls the routine Glue_Control with XIC(Glue_Enabled) JSR(Glue_Control, 0). Inside it, XIC(Glue_Demand) OTE(Glue_Valve) drives the glue valve. When an operator disables glue with Glue_Enabled, the valve sometimes stays open and floods the flaps. Explain, and fix it two ways.

Show the solution

When Glue_Enabled goes to 0, the JSR stops calling the subroutine, so the OTE inside it is never executed again. An OTE only writes when it runs; one that is not scanned keeps its last value. If the valve was open when glue was disabled, it stays open. Rockwell’s SLC 500 manual describes exactly this: a bit set in a subroutine stays set until the subroutine is scanned again.

Fix one: call the routine every scan and put XIC(Glue_Enabled) on the valve rung inside it, so the OTE always runs and writes 0 when glue is off. Fix two: keep the conditional call but clear the subroutine’s outputs when it is skipped, for example with XIO(Glue_Enabled) OTU(Glue_Valve) in the calling routine (a deliberate exception to the one-owner rule: the two never run in the same scan). Fix one is clearer and is what I would choose.

Problem 5: the stack light that ignores the guard

A colleague added guard monitoring to an existing machine. The stack light rung near the top of the routine is XIC(Line_Fault) OTE(Red_Light). The new rung, at the bottom, is XIC(Guard_Open) OTE(Red_Light). During testing, red comes on for an open guard but not for a line fault. Explain why, and write the correct rung.

Show the solution

Two OTEs own Red_Light. The guard rung is lower, so its value is the one the output receives: 1 when the guard is open, 0 otherwise. When a line fault occurs with the guard closed, the first rung writes 1 and the guard rung overwrites it with 0 before the outputs are updated. The light never shows the fault.

[XIC(Line_Fault) ,XIC(Guard_Open) ] OTE(Red_Light);

One owner, both reasons in parallel, and delete the second rung. Then run a cross reference on every output the change touched. A guard monitoring signal shown on a stack light is status for the operator; the guard’s protective function belongs to the safety system.

Where OTE fits in this guide

OTE is the third instruction in Joltek’s PLC Programming guide, after the input contacts XIC and XIO. With those three you can build most of the rungs in a machine program. The next pages cover the two other output instructions, OTL and OTU, then the one-shot, timers and counters. The instruction glossary lists them all.

If your team needs this kind of grounding on its own equipment and programs, that is what our hands-on PLC and SCADA training for plant teams is for.

References and further reading

  1. Logix 5000 Controllers General Instructions Reference Manual (1756-RM003) · Rockwell AutomationOutput Energize (OTE): operand, execution table including prescan and postscan clearing. Read in revision P (December 2014).
  2. SLC 500 Instruction Set Reference Manual (1747-RM001) · Rockwell AutomationOTE reset on entering Run, on power restore and in a false MCR zone; multiple output instructions on one address not recommended.
  3. LAD (S7-1200, S7-1500): Assignment · Siemens, TIA Portal V20 online help
  4. MELSEC iQ-R Programming Manual (Program Design), SH(NA)-081265ENG · Mitsubishi ElectricCoil, inverse coil, set and reset coils.
  5. CODESYS LD/FBD: Coil · CODESYS Group, online help
  6. SIMATIC S7-1500 Cycle and Response Times, Function Manual · SiemensThe process image of the outputs is written to the modules at the end of the cycle.
  7. ControlLogix 5590 Controllers User Manual: Determine When I/O Data Is Updated (1756-UM900) · Rockwell AutomationI/O data is refreshed asynchronously to logic execution.

← PLC Programming guide and instruction glossary

Have a project that needs technical ownership?

Send us the situation. If it is not something we should take on, we will say so.

The Plant-Side Brief

The weekly brief for the people who own a plant’s control systems.

One email every Wednesday for engineering and operations leaders responsible for controls, SCADA, MES and OT networks. Skim the top in two minutes; read the Deep Dive when you have fifteen.

  • One modernization problem, worked through to cost, risk and a schedule you can defend. The Deep Dive.
  • End-of-support dates before they reach your plant Windows, servers, controllers and HMI software. Lifecycle Watch.
  • A checklist your engineers can run that week not a framework to admire. Field Kit.
  • Every number sourced, no vendor agenda we are paid by plants, never by vendors.