Codesys Sfc Example Apr 2026
Lena pointed at the HMI. "No. The SFC saved it. Look—step history."
This is how industrial programmers think. Not just "code that runs"—but .
Transition from Step 20: Condition: (T#45s) AND NOT EStop_Pressed Supervisory Logic (Parallel Branch): IF EStop_Pressed THEN Jump to Step 99: EMERGENCY_RETRACT END_IF codesys sfc example
In CODESYS SFC, she right-clicked Step 20 and selected . She created an Action named Acid_Emergency . She set its qualifier to N (Non-Stored, executes while step is active) and S (Set/Stored for emergency).
She slammed her fist on the desk.
The transition to Step 0 required Acid_Level < 5% . But the drain valve closed after 2 seconds because the "DIP" step's action had been deactivated. She forgot: Actions in SFC only run while their step is active.
Crane_Up := TRUE; Acid_Drain_Valve := TRUE; // SD qualifier keeps this ON Emergency_Alerter := TRUE; Inside Step 0 's Entry Action: Lena pointed at the HMI
She added a parallel to the main sequence:
Lena shook her head. "No. We need an SFC." She opened CODESYS and created a new POU (Program Organization Unit). She chose Sequential Function Chart (SFC) . No ladder. No structured text loops. Just pure, visual, time-tested sequence logic. Look—step history
Acid_Drain_Valve := FALSE; // Reset only when safe Emergency_Alerter := FALSE; Three weeks later, the line went live.
But then... nothing.