Creating an Interrupt Task for the Interrupt Inputs

If one or more channels of DC541-CM 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 of Automation_Builder:

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

For each Communication Module slot, two types of interrupt tasks are available in the Event list box:

  • Ext_Communication ModuleX_InputAny:

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

  • Ext_Communication ModuleX_InpuAny_high_prio:

    The task is triggered by any interrupt from Communication Module slot X 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 is without any 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 below, the task is named HIGHInterrupt_1, meaning that it is a high-priority interrupt from Communication Module slot 1. The task type is “external event triggered” and the event to trigger the task is “Ext_Communication Module1_InputAny_high_priority”.

../_images/6240086fe38b5b010a33139000eba54e1

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

../_images/a16b4814e38b5beb0a33139000eba54e1

In the example, the program DC541_Interrupt_Ext1() shall be started with any interrupt from Communication Module slot 1.

../_images/c7c15d46e38b5b4f0a33139000eba54e1

The task configuration for an AC500 equipped with two DC541-CM modules inserted in the Communication Module slots 1 and 2 and containing one cyclically running “background program” PLC_PRG could for example look as follows. Here, an interrupt from slot 1 should start the program DC541_Interrupt_Ext1 with high priority, an interrupt from slot 2 should start the program DC541_Interrupt_Ext2 with priority 2:

../_images/e1489624e38b5b9d0a33139000eba54e1