Topic: DMD0146 EXIT - Exit This Program |
|
---|
The Exit This Program (EXIT) instruction will cause the Program that contains the EXIT instruction to immediately stop running when this instruction is executed. Any ladder logic between the EXIT and the end of the Program will not be executed.
Once a Program has been started with the Run Program (RUN) instruction it will continue to run as long as the PLC remains in Run mode. In cases where the Program can determine that it needs to stop running, placing one or more EXIT instructions at the appropriate points in the Program is the proper method to stop the Program from running. A good example is a Program that is handling communicating with an external device. This Program could have one exit condition for when communication successfully completes and a separate exit condition when errors are detected. When the Program exits, its associated structure will be initialized (this includes resetting the Stages, clearing internal flags, counters, etc.) in preparation for the next time it is run.
When the Program exits, the Termination Logic
Note: an EXIT instruction cannot be placed in $Main.
|
|
Parameters:This instruction has no parameters.
|
|
Status Display:
The green triangle in the upper left corner indicates this is a Skipping instruction.
|
|
See Also:
EXIT - Exit This Program
RESTART - Restart Program or Task
|
|
Related Topics:Overview of Code Blocks (Programs, Tasks, Subroutines and Interrupt Service Routines)
Modifying the Execution Order of Programs and Tasks
|
|
Rung Example:
|
|