How to program event processing
(Original Document)
Procedure
The table below summarizes the essential steps for programming event processing.
Step
Action
1
Configuration phase
In offline mode, in the configuration editor, select Event processing and the event number for the counting channel.
2
Unmasking phase
In particular, the MAST or FAST calling task must:
  • Enable processing of events at system level: set bit %S38 to 1 (default value).
  • Unmask events in MAST and FAST tasks with the UNMASKEVT instruction (active by default).
  • Unmask events concerned at channel level by setting implicit event unmasking language objects to 1. By default, the events are masked.
  • Check that the stack of events at system level is not saturated (bit %S39 must be at 0).
3
Event program creation phase
On the Events tab, select Edit → New event section and create the event program. In particular, this program must:
  • Determine the source of the event(s) from the event status word in implicit exchange.
  • Carry out the reflex tasks associated with the event. This process must be as short as possible.
Note: the event status word is automatically reset to zero.
Illustration of event unmasking
This figure shows event unmasking in the MAST task.
Illustration of the contents of an event task
This figure shows the possible contents of an event task (testing event and action bit).