The following section describes the various task types available for your program, along with a description of the task type characteristics.
A Cyclic task is assigned a fixed cycle time using the Interval setting in the Type section of Configuration subtab for that task. Each Cyclic task type executes as follows:
1. Read Inputs: The physical input states are written to the %I input memory variables and other system operations are executed.
2. Task Processing: The user code (POU, and so on) defined in the task is processed. The %Q output memory variables are updated according to your application program instructions but not yet written to the physical outputs during this operation.
3. Write Outputs: The %Q output memory variables are modified with any output forcing that has been defined; however, the writing of the physical outputs depends upon the type of output and instructions used.
For more information on defining the bus cycle task, refer to the EcoStruxure Machine Expert Programming Guide and Modicon M218 Logic Controller Settings.
For more information on I/O behavior, refer to Controller States Detailed Description.
NOTE: Expansion I/Os are always physically updated by the MAST task.
4. Remaining Interval time: The controller firmware carries out system processing and any other lower priority tasks.
NOTE: If you define too short a period for a cyclic task, it will repeat immediately after the write of the outputs and without executing other lower priority tasks or any system processing. This will affect the execution of all tasks and cause the controller to exceed the system watchdog limits, generating a system watchdog exception.
A Freewheeling task does not have a fixed duration. In Freewheeling mode, each task scan begins when the previous scan has been completed and after a short period of system processing. Each Freewheeling task type executes as follows:
1. Read Inputs: The physical input states are written to the %I input memory variables and other system operations are executed.
2. Task Processing: The user code (POU, and so on) defined in the task is processed. The %Q output memory variables are updated according to your application program instructions but not yet written to the physical outputs during this operation.
3. Write Outputs: The %Q output memory variables are modified with any output forcing that has been defined; however, the writing of the physical outputs depends upon the type of output and instructions used.
For more information on defining the bus cycle task, refer to the EcoStruxure Machine Expert Programming Guide and Modicon M218 Logic Controller Settings.
For more information on I/O behavior, refer to Controller States Detailed Description.
4. System Processing: The controller firmware carries out system processing and any other lower priority tasks (for example: HTTP management, Ethernet management, parameters management).
NOTE: If you want to define the task interval, refer to Cyclic Task.
This type of task is event-driven and is initiated by a program variable. It starts at the rising edge of the boolean variable associated to the trigger event unless pre-empted by a higher priority task. In that case, the Event task will start as dictated by the task priority assignments.
Step |
Action |
---|---|
1 |
Double-click the TASK in the Applications tree. |
2 |
Select Event from the Type list in the Configuration tab. |
3 |
Click the Input Assistant button Result: The Input Assistant window appears. |
4 |
Navigate in the tree of the Input Assistant dialog box to find and assign the my_Var variable. |
This type of task is event-driven and is initiated by the detection of a hardware or hardware-related function event. It starts when the event occurs unless pre-empted by a higher priority task. In that case, the External Event task will start as dictated by the task priority assignments.
For example, an External Event task could be associated with an HSC Threshold cross event. To associate the HSC2_TH1 event to an External Event task, select it from the External event drop-down list on the Configuration tab.
Depending on the related product, there are up to 2 types of events that can be associated with an External Event task:
oRising edge on Fast input (%IX0.0 ...%IX0.3 inputs)
oHSC thresholds