|
|
Topic: P169 |
Call Task (CALL) Instruction |
|
Icon / Button =
![]()
Used to execute Tasks that are set to Run When Called. When Enabled, Call Task will jump program execution immediately to the Called Task. When the END statement of the Called Task is reached, program execution will return to the rung following the Call Task instruction. Tasks in the Run When Called folder can be called multiple times per scan.
|
Parameter |
Parameter Type |
Requirements |
Description |
|
Enable |
Ladder Input |
Must Have |
Level-driven. When Enable is ON, the instruction will operate every scan. When Enable is OFF, the instruction is not solved and its Outputs are not updated. |
|
Task To Run |
Task |
Must Have |
The specified Task to be run. |
Note: A Task must be located in the Run When Called folder of the Task Management Tool in order to select the Task To Run when configuring the Call Task instruction.
Note: Nesting of a Task (Calling a Task from within another Task) that has been placed in the Run When Called folder is not allowed and will generate an error when compiled.
Note: Tag Values are updated immediately as each Ladder Rung is executed, top to bottom. However, Tag Values representing physical Outputs are only applied to the physical Output after the END statement of the last Task to be scanned is reached. Outputs in Remote Base Groups have additional limitations regarding Update Intervals.
When Call Task Instruction is selected the window shown below opens with defaults shown.
|
Parameter Configuration Table |
||||||||||||
Call TaskInstruction |
|
|
|
|
|
|
|
|
Notes |
|||
|
|
Task To Run |
Select the Name of an existing Task in the Run When Called folder. |
||||||||||
In this application example, there are three temperature probes tied to analog input cards. Each requires linear scaling and validity calculation. Additionally, the scaled Fahrenheit measurement will be converted to Celsius. Each Temperature Probe will be processed with a Call Task instruction.
In the Main Program task, analog inputs and module status bits are copied to instances of a User-Defined Structure (UDS). These structures are then copied to a working copy of the UDS and the translation task is called. This task performs a linear scale (SCL) on the incoming analog signal based on the chosen resolution of the analog input card. The working copy of the UDS is then copied back to the original structure.
This is then repeated for every temperature probe in the program, utilizing the same Called Task. To configure the Called Task, go to the Task Management tool of the Productivity Suite Software. Add new Tasks in the Run When Called folder (right click) as shown below.
Then double-click on a newly created Task and edit the Called Task.
Return to the Main Program to configure a Call Task instruction. Assign one of the Tasks by selecting its TaskName from the drop-down.