Interrupt Handling with Control Expert
(Original Document)
Introduction
Control Expert uses a multi tasking structure in the PLC. An application may consist of any of the following tasks:
The task used for interrupt processing is the Event task which will be described here in more details. For a complete overview on the multitasking software structure refer to EcoStruxure™ Control Expert, Program Languages and Structure, Reference Manual.
Task Sequence
The following diagram illustrates the task sequence of multitasking processing with a cyclic master task, a fast task with a 20ms period and event processing:
I: 
Acquisition of Inputs
P: 
Program processing
O: 
Updating of Outputs
Task Priorities
The following diagram shows the positioning of the Event tasks in the priority hierarchy of a multitasking structure:
Event Processing
Event processes can either be triggered by the event timer or through an input signal from the HLI module. Within the Event tasks there is again a hierarchy of priorities.
The following diagram shows the positioning of the I/O events in the priority hierarchy of the Event tasks:
Rules for I/O Event Priorities
The following list shows which basic rules apply to Event process priorities.
The following illustration shows the interdependence between slot/channel number and the priority of an input signal:
Control of Event Processing
The various types of event processing can be globally validated or inhibited by the application program, by using the system bit %S38. If one or more events occur while they are inhibited, the associated processing is lost.
Two elementary functions of the language, MASKEVT() and UNMASKEVT(), used in the application program can also be used to mask or unmask event processing.
If one or more events occur while they are masked, they are stored by the system and the associated processing is carried out after unmasking.