Processing of Inputs and Outputs in the Multitasking System

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

../_images/94ea9eb5e38c4b760a33139000eba54e

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 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.

  4. Inputs of Communication Modules line 0 to 4

    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, the inputs used in the task are copied byte-wise from the input data image to the image. Byte-wise means that when using, for example, the input %IX0.0, the image of the inputs %IX0.0 … IX0.7 will be copied to the image.

Because only those inputs are copied that are directly used in the task, it is not possible to read the inputs indirectly, if cycle consistency is required.

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, the outputs used in the task are copied byte-wise from the image to the output data image. Byte-wise means that when using, for example, the output %QX0.0, the image of the outputs %QX0.0 … QX0.7 will be copied from the image to the output data image. The internal variables “Output data image updated” for the CS31 processor and the Communication Modules 0 .. 4 will be set.

Writing the Outputs:

  1. With the next interrupt of the I/O bus driver, the outputs of the output data image will be written and the variable “Output data image updated” will be reset.

  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 and the variable “Output data image updated” will be reset.

  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 and the variable “Output data image updated” will be reset.

  4. Outputs of the Communication Module Line 0 to 4

    With the next interrupt of the Communication Module, the outputs of the output data image will be written to the DPR and the variable “Output data image updated” will be reset.

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.