Control Expert · Modicon M580 · the execution model

Tasks, Sections & Priority

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.

⏱️ MAST⚡ FAST🔔 EVENT
01 · The pumping station

Three tasks, one wet well

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.

MAST · running
level: 20%
HI float
Pump 1 · duty
🌀
OFF
Pump 2 · standby
🌀
OFF
ePAC scheduler — newest on the rightMAST scans: 0
EVENT prio
FAST 10 ms
MAST periodic

MAST program · sections execute top → bottom each scan

SECTION 1
Inlet
Read level transmitter, scale to %
SECTION 2
PumpControl
Start/stop duty pump on level
SECTION 3
Alarms
Latch faults, drive the HMI
MAST mode
inflow

👀 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.

02 · The task hierarchy

Who interrupts whom

⏱️
MAST
priority: lowest · always present
The main task. Cyclic (loops back-to-back as fast as it can) or Periodic (a fixed period, e.g. 50 ms). Holds the bulk of your program, organised into Sections.
FAST
priority: higher · periodic
A short, high-priority periodic task (e.g. 5–10 ms) for time-critical logic. It preempts MAST — keep it small, or MAST starves.
🔔
EVENT
priority: highest · on demand
Timer- or I/O-triggered tasks (TIMERx / EVTx) that fire the instant the event occurs, preempting everything. For reactions that simply cannot wait for the next scan.

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.

03 · Check yourself

Where does it go?

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?