TND PLC Instruction: Temporary End Behavior
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
- 1List every write located after TND and define the required state when it is skipped.
- 2Confirm whether the routine is a main routine or subroutine and document where execution resumes.
- 3Test TND rung false, true on entry and true after outputs were previously energized.
- 4Test controller startup, fault recovery and mode changes with the early-exit condition active.
- 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.
| Platform | Common term | What to verify |
|---|---|---|
| Rockwell Studio 5000 | TND (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 7 | RET / RETURN | Ends the current block and resumes in the caller or execution system; ENO/return behavior differs from TND. |
| CODESYS | Return element / RETURN | Exits the current block when its condition is true. Confirm allowed POU context and return semantics. |
| IEC portability | No universal TND mnemonic | Express early-exit intent explicitly and revalidate skipped-output behavior when porting. |
Conditional routine exit
Rung 1 |--[ CommissioningHold ]--[ Clear commanded state ]--[ TND ]--|
| TRUE → exit current routine after explicit cleanup |
Rung 2 |--[ AutoEnable ]--[ PermissivesOK ]--( ConveyorCommand )------|
| skipped when the TND above executes |Where execution continues after TND
The current routine ends, but the controller continues its configured execution path.
| State / phase | TND rung false | TND rung true | What is not implied |
|---|---|---|---|
| Inside a subroutine | Next rung executes | Return to the calling routine | Controller does not enter Program or Stop mode |
| Inside a main routine | Next rung executes | Continue with the next program in the task | The entire task is not cancelled |
| Destinations below TND | Their instructions execute normally | No write from skipped instructions | They are not automatically de-energized |
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
| Symptom | Likely cause | Check next |
|---|---|---|
| An output remains on after TND becomes true | Its producing rung was skipped and no explicit false write occurred | Move defined-state handling before TND or redesign routine control. |
| Unrelated logic stops updating | TND was placed too early or in a main routine with broad scope | Trace routine and program scheduling, then narrow or remove the early exit. |
| Ported program behaves differently | RET/RETURN was assumed to be identical to Rockwell TND | Compare caller, main-block, output and return-value semantics in both platforms. |
| TND is being used as an emergency-stop path | Program flow was confused with functional safety | Remove 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.
- Temporary End (TND), Studio 5000 V38.01
Rockwell Automation — Availability, execution and return behavior
- RET return instruction, STEP 7 V21
Siemens — Related Siemens block-exit behavior and ENO semantics
- Structured Text RETURN statement
CODESYS Development — Related conditional block-exit behavior
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.
Continue Learning
Ready to deepen your understanding of TND (Temporary End)? Here are some recommended resources:
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
- Category
- Ladder Logic Elements
- Difficulty
- Intermediate
- Tier
- Advanced
About Ladder Logic Elements
Contacts, coils, timers, counters, and ladder diagram components