Topic: DMD0151

Help File Version: 2.10.0.636

RESTART - Restart Program or Task


The Restart Program or Task (RESTART) instruction is used to stop a Program or Task that is currently running, and then restart it so that is begins running from the beginning. This instruction can be used to restart the Program or Task that contains the instruction (restart itself) or to restart a different Program or Task.

 

When the Program or Task is stopped the Termination LogicClosed The additional processing that an instruction has that is run when the code block that contains the instruction is disabled. For example, it is the termination logic of an Output (OUT) coil in a stage that turns OFF the coil when that stage is disabled by a Jump or Stage Reset instruction. for that Program or Task will run. During their termination scan, Programs and Tasks will run the termination logic for each individual instruction that is contained within the code-block, then will run their own termination logic. All of the Output Coil (OUT) instructions, and any output coil in any instruction that has one as a parameter (for example TIMEPROP) are turned OFF. All of the Timers and Counters are reset. If the Program contains Stage (SG) instructions, all of the Stages in that Program will be disabled. The code-block's associated structure will be initialized (clearing internal flags, counters, etc.) in preparation for being restarted.

 

 


Parameters:

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Code Block selects the Program or Task to be restarted.

 


Status Display:

 

If the Code Block parameter is the same as the Code Block that contains this instruction (the Code Block is restarting itself ), there will be a green triangle in the upper left corner of the status display to indicate this is a Skipping instruction.

 

The gray triangle at the right end of the input leg indicates the input is Edge TriggeredClosed Each time the input logic transitions from OFF to ON this instruction will execute. With each execution, this instruction will run to completion even if the input logic transitions to OFF before the instruction completes..

 


See Also:

ENTASK - Enable Task

 

RUN - Run Program

 

EXIT - Exit This Program

 

HALT - Halt Program or Task

 

RESTART - Restart Program or Task

 

SUSPEND - Suspend Program or Task

 

YIELD - Yield Program or Task

 


Related Topics:

Overview of Code Blocks (Programs, Tasks, Subroutines and Interrupt Service Routines)

 

Modifying the Execution Order of Programs and Tasks

 

Termination Scan Behavior

 


Rung Example: