A Modicon ePAC doesn't run one loop — it runs several, racing by priority. The MAST task does the everyday work, sliced into ordered Sections. The FAST task cuts in for time-critical checks. An EVENT task barges in the instant something happens. Watch all three guard a pumping station, and trip the event yourself.
The wet well fills with inflow. MAST runs the level control in three Sections every period; FAST runs a fast over-level trip on a tight cycle; the EVENT task fires the instant the high-level float switch closes — too urgent to wait for the next MAST scan. Run it, push the inflow up, and hit 🔔 Trip high-level float to watch EVENT preempt everything.
👀 The red EVENT bar lands on top of the green MAST bar — MAST is paused mid-section so the standby pump starts immediately. That's the whole reason event tasks exist: some things can't wait for "next scan." FAST (yellow) ticks on its own fast clock no matter how busy MAST gets.
There's also an AUX task (slow, low-priority background work) on bigger CPUs. The golden rule: the higher the priority, the shorter the code must be — and every task has a watchdog that trips the CPU if its logic overruns.
A safety-critical over-level must trip the pumps within a few milliseconds, far faster than the 50 ms MAST period. Where do you put that logic?