Creating an Interrupt Task

If one or more channels of the onboard I/Os are configured as interrupt inputs, a corresponding interrupt task has to be created to enable the processing of the interrupt(s).

For this purpose, a new task has to be added in the task configuration:

  • Enter the task name
  • Set the task type to triggered by external event
  • Specify the event that triggers the task

2 types of interrupt tasks are available in the Event list box:

  • InputAny

    The task is triggered by any interrupt with the priority specified in the Priority field (0…31).

  • InpuAny_high_prio

    The task is triggered by any interrupt with highest priority, i. e. with a priority higher than the max. adjustable “0” and higher than the priority of the communication task. In this case, the priority (0…31) specified in the Priority field has no significance.

Note

If the interrupt task is started with highest priority, the program execution time must not be longer than approx. 400 µs. Otherwise online access is no longer possible.

In the example, the task is named PM554_Interrupt. It is configured as a high-priority interrupt. The task type is triggered by external event and the event to trigger the task is InputAny_high_priority.

../_images/9e28b6f3e38c4e440a33139000eba54e

Like for all other tasks, a program call has to be assigned to the task.

../_images/9fbf9a5ee38c4ea10a33139000eba54e

In the example, the program PM554_Interrupt_1() shall be started with any interrupt from onboard I/Os.