Topic: DMD0145

ENTASK - Enable Task


The Enable Task (ENTASK) instruction is used to enable a user-defined Task to run as part of the subsequent controller scan.

 

This instruction does NOT cause the controller to immediately begin execution of the Task, rather it configures the Task to run when the controller gets to it as part of its normal scan processing. If the Task exists later in the execution order the Task will begin execution on the same controller scan. If the Task exists earlier in the execution order the Task will begin execution on the subsequent scan.

 

By default, user-created Tasks will be executed in the order that they are added to the project. The execution order of the code-blocks in a project can be modified through the Project Browser.

 

Parameters:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Task - the name of the Task to enable. This can be a Task that already exists, or follow the steps below to create a new Task code-block:

 

Note: choosing to create a new heap item will change the System Configuration. Changes to the System Configuration can only be saved to the Do-more controller when it is in PROGRAM mode. Additional Run mode updates can not be performed until these System Configuration changes have been saved to the controller.

 

If a name was entered that is NOT an existing Task, this Create Task message box will be displayed. This could have happened because the Task name was misspelled, or because the programmer wants to create a new Task.

 

Click Yes to create a new Task using the name provided in the Task field. Note: this does NOT create the code-block, this is only the heap item. The code-block can be created in the next step.

 

Click No to return to the Editor for the ENTASK instruction so that a different name can be entered.

 

 

If Yes was selected in the previous message box, the programmer will also be given the chance to create the code-block associated with the Task that was just created.

 

Click Yes to create the code-block at this time. The associated code-block will be created and the Code-block Configuration dialog will then be displayed where the user can configure the runtime settings and the code-block protection.

 

Click No to create the code-block later. Note: the code-block for this Task must be created before the project can be downloaded to the controller.

 

 

If an existing ENTASK instruction is being edited and the Task name is changed to a Task that does not exist, a different Create Task message box will be displayed. Again, this could have happened because the Task name was misspelled, or because the programmer wants to create a new Task.

 

Click Yes to create a new Task using the name provided in the Task field. Note: this does NOT create the code-block, this is only the heap item. The code-block can be created in the next step.

 

Click No to return to the Editor for the ENTASK instruction so that a different name can be entered.

 

 


Enable - specifies when and how often the Task will run

 

  • Once on Leading Edge - select this option to have the Task run to completion exactly one time when the input logic transitions from OFF to ON. Depending on the contents of the Task, this may take more than one PLC scan, but the entire Task will be executed then it will be disabled. Configured this way the Enable Task instruction is edge triggered and will have a gray triangle at the right end of the input leg to indicate this.

 

  • Continuous on Power Flow - select this option to have the Task run as long as the ENTASK instruction has power flow. Once the end of the Task is reached, it will remain enabled and execution will start over at the top of the Task.

 

at Interval - specifies how much time (in milliseconds) to wait before the Task is allowed to run. After the Task has run to completion, if the ENTASK instruction still has power flow, the Task will remain enabled and will wait the specified amount of time before running again. This can be any constant value between 0 and 2,147,483,647, or any readable numeric location.

 

As long as the input logic remains ON, the value of 0ms means the Task will run again on the next scan.

As long as the input logic remains ON, the Task will run again when the Interval time is reached.

 

When configured to run at an interval, the status display will display the Tasks's .IntervalAcc value that contains the amount of time (in milliseconds) before the Task will run again.


See Also:

 


Related Topics:

 


Rung Example: