Learn PLCs free
Ladder Logic ElementsIntermediateAdvanced
5 min read
Updated
Intermediate

TND PLC Instruction: Temporary End Behavior

TND - TND (Temporary End)

Quick answer

TND (Temporary End) is a Rockwell program-control instruction that conditionally ends the current routine. In a subroutine it returns to the caller; in a main routine it returns control to the next program in the task. Logic after TND is not executed on that pass.

Key Takeaways

  • TND (Temporary End) is a Rockwell program-control instruction that conditionally ends the current routine. In a subrouti...
  • Intermediate-level topic in Ladder Logic Elements
  • Commonly used in: Conditionally exiting a routine after explicit state handling, Controlled commissioning or diagnostic paths

Detailed Definition

TND is a conditional early exit from the routine that contains it. When its ladder rung is false, execution continues. When true, the remaining rungs in that routine are skipped. Studio 5000 also supports TND() in Structured Text.

TND does not mean “stop the PLC,” “end the whole task” or “turn every output off.” A coil or instruction after TND is simply not evaluated on that pass, so its destination can retain the value written previously. This makes TND useful for tightly controlled early-exit logic but risky as an informal bypass. It is not a safety instruction and must not replace a validated safety function.

Evidence and scope

Routine-exit behavior was checked against current Rockwell Studio 5000 V38.01 documentation. TND is Rockwell terminology rather than a portable IEC function; Siemens RET and CODESYS RETURN are related early-exit mechanisms, not drop-in equivalents.

Technical review:

Critical behavior

  • TND ends only the current routine execution; where control resumes depends on whether that routine is a main routine or subroutine.
  • Instructions below the executed TND are not scanned on that pass, so their destinations are not automatically cleared.
  • A false TND rung does nothing and normal execution continues with the next rung.
  • TND has no operands in Studio 5000 and is available in Ladder Diagram and as TND() in Structured Text, not Function Block Diagram.
  • TND is vendor-specific program control, not an IEC-standard safety or shutdown instruction.

Verification checklist

  1. 1List every write located after TND and define the required state when it is skipped.
  2. 2Confirm whether the routine is a main routine or subroutine and document where execution resumes.
  3. 3Test TND rung false, true on entry and true after outputs were previously energized.
  4. 4Test controller startup, fault recovery and mode changes with the early-exit condition active.
  5. 5Keep TND out of safety claims; validate safety functions independently with approved hardware and procedures.

IEC and vendor terminology

Similar-looking instructions do not always have identical execution, initialization or storage behavior.

PlatformCommon termWhat to verify
Rockwell Studio 5000TND (Temporary End)Conditionally ends the routine; a subroutine returns to its caller and a main routine yields to the next program in the task.
Siemens STEP 7RET / RETURNEnds the current block and resumes in the caller or execution system; ENO/return behavior differs from TND.
CODESYSReturn element / RETURNExits the current block when its condition is true. Confirm allowed POU context and return semantics.
IEC portabilityNo universal TND mnemonicExpress early-exit intent explicitly and revalidate skipped-output behavior when porting.

Conditional routine exit

Handle commanded state before the exit. Never assume that skipping a later output instruction forces its destination false.

Where execution continues after TND

The current routine ends, but the controller continues its configured execution path.

State / phaseTND rung falseTND rung trueWhat is not implied
Inside a subroutineNext rung executesReturn to the calling routineController does not enter Program or Stop mode
Inside a main routineNext rung executesContinue with the next program in the taskThe entire task is not cancelled
Destinations below TNDTheir instructions execute normallyNo write from skipped instructionsThey are not automatically de-energized
Rockwell Studio 5000 routine behavior. Other vendors’ return instructions have related but not identical semantics.

Working LD and ST example

Exit only after defining the disabled command state

Record why the path was taken and clear normal command state before ending the routine.

Ladder Diagram

|--[ CommissioningHold ]--[ MOV 1 ExitReason ]--[ OTU CycleActive ]--[ TND ]--|
|--[ CycleActive ]--[ PermissivesOK ]------------------( ConveyorCommand )--|

Structured Text

IF CommissioningHold THEN
    ExitReason := 1;
    CycleActive := FALSE;
    ConveyorCommand := FALSE;
    TND();
END_IF;

ConveyorCommand := CycleActive AND PermissivesOK;

Expected result: When CommissioningHold is true, the command state is explicitly cleared and later routine logic is skipped. This normal-control example does not implement a safety function.

Failure modes and diagnostic checks

SymptomLikely causeCheck next
An output remains on after TND becomes trueIts producing rung was skipped and no explicit false write occurredMove defined-state handling before TND or redesign routine control.
Unrelated logic stops updatingTND was placed too early or in a main routine with broad scopeTrace routine and program scheduling, then narrow or remove the early exit.
Ported program behaves differentlyRET/RETURN was assumed to be identical to Rockwell TNDCompare caller, main-block, output and return-value semantics in both platforms.
TND is being used as an emergency-stop pathProgram flow was confused with functional safetyRemove that assumption and implement the approved safety architecture and validation.

Current primary and technical sources

These sources support the behavior summarized on this page. The project's controller, firmware and IDE help remain authoritative for implementation.

Continue with the practical guide

Common Questions

What is TND (Temporary End)?

TND (Temporary End) is a Rockwell program-control instruction that conditionally ends the current routine. In a subroutine it returns to the caller; in a main routine it returns control to the next program in the task. Logic after TND is not executed on that pass.

When should I use TND (Temporary End)?

TND (Temporary End) is particularly useful in scenarios such as Conditionally exiting a routine after explicit state handling and Controlled commissioning or diagnostic paths. Consider implementing it when you need reliable, efficient solutions for these types of applications.

What should I verify before using TND (Temporary End)?

List every write located after TND and define the required state when it is skipped. Confirm whether the routine is a main routine or subroutine and document where execution resumes. Test TND rung false, true on entry and true after outputs were previously energized. Test controller startup, fault recovery and mode changes with the early-exit condition active. Keep TND out of safety claims; validate safety functions independently with approved hardware and procedures.

What are related concepts I should learn?

To fully understand TND (Temporary End), you should also familiarize yourself with TON (Timer On-Delay), TOF (Timer Off-Delay), and CTU (Count Up). These concepts work together in industrial automation systems.

Was this helpful?

Let us know if this glossary term helped you understand TND (Temporary End) better.

Your feedback helps us improve our glossary and create better content for the PLC programming community.

Quick Info

Difficulty
Intermediate
Tier
Advanced

About Ladder Logic Elements

Contacts, coils, timers, counters, and ladder diagram components

Total Terms:70
Difficulty:Beginner to Intermediate

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch machine scenarios react. A 12-lesson curriculum across 8 PLC dialects — free account, no credit card.

Practice PLCs free →