Processing of Inputs and Outputs in the Multitasking SystemΒΆ

Caution

:strong:Multitasking

All configured inputs are updated in Image with the values of IO image at the start of an IEC task. All configured outputs are updated in IO image with the values of Image at the end of an IEC task (see following figure).

If, for example, task 1 has the higher priority and input %IX0.0 is used in task 1 and task 2, the value can change during the cycle of task 2 as it is updated every time task 1 is started. This is not relevant for programs with only one task.

The following figure shows how the inputs and outputs are processed in the multitasking system.

../_images/8d4751bee94f79a30a317f3437f0230b

Generation of the Input Data Image:

  1. Inputs at the I/O bus

    After all I/O modules have been processed at the I/O bus, a corresponding interrupt is generated in the processor. The inputs are copied to the input data image during the Interrupt Service Routine (ISR). If the outputs were updated by a task, the outputs in the output data image are copied.

  2. Inputs at the CS31 system bus

    After the CS31 driver has processed all I/O modules, a corresponding interrupt is generated in the processor. The inputs are copied to the input data image during the Interrupt Service Routine (ISR). If the outputs were updated by a task, the outputs in the output data image are copied.

  3. Inputs of onboard I/O of AC500 PM55x and PM56x CPUs

    After Onboard I/Os have been processed, a corresponding interrupt is generated in the processor. The inputs are copied to the input data image during the Interrupt Service Routine (ISR). If the outputs were updated by a task, the outputs in the output data image are copied.

  4. Inputs of Communication Modules line 0 to 6

    Once a Communication Module has received new data, a corresponding interrupt is generated in the processor. The inputs are copied from the DPR to the input data image of the processor during the Interrupt Service Routine (ISR). If the outputs were updated by a task, the outputs in the output data image are copied to the DPR.

    Precondition for this is a valid Communication Module configuration.

Starting a Task:

When starting a task, all configured inputs are copied from the input data image to the image.

Processing a Task:

All tasks access the image, i.e., inputs are read from the image and outputs are written to the image. In ONLINE mode, the inputs/outputs of the image are displayed.

Termination of processing the Output Data Image by a Task:

At the end of the task processing, all configured outputs are copied from the image to the output data image.

Writing the Outputs:

  1. Outputs at the I/O Bus

    With the next interrupt of the I/O bus driver, the outputs of the output data image will be written.

  2. Outputs at the CS31 System Bus

    With the next interrupt of the CS31 processor, the outputs of the output data image will be written.

  3. Outputs of Onboard I/O of AC500 PM55x and PM56x CPUs

    With the next interrupt of the I/O Bus driver, the outputs of the output data image will be written.

  4. Outputs of the Communication Module Line 0 to 6

    With the next interrupt of the Communication Module, the outputs of the output data image will be written to the DPR.

I/O Update Task:

In order to update the inputs/outputs not used in the task, all inputs/outputs of the image are updated by a lower priority task (I/O update task). This task is only processed if no other user task runs.