Interrupt Handler for KP9x Devices

In case a KP9X coupler requires handling of incoming interrupts, an interrupt handler has to be configured.

For this purpose, a new task has to be added in the task configuration of the Automation_Builder. Enter the task name, set the task type to “external event triggered” and specify the event that triggers the task.

For each Extension Bus slot, two types of interrupt tasks are available in the “Event” list box:

  • Ext_CouplerX_InputAny:

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

  • Ext_CouplerX_InpuAny_high_prio:

    The task is triggered by any interrupt from Extension Bus 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.

Attention

If the interrupt task is started with high priority (Ext_CouplerX_InpuAny_high_prio), 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 KPInterruptHdlr_2, meaning that it is an interrupt from Extension Bus located at slot 2 (where AC31 Extension Bus is located for AC31 adapter systems). The task type is “external event triggered” and the event to trigger the task is “Ext_Coupler2_InputAny”.

../_images/3cf64412e270f9f50a317f345ed0c977

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

../_images/3bbf1327e27107ea0a317f341b8ccaf1

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

../_images/2110527fe2710b150a317f34578acc98