SFC Action Qualifiers: L Time Limited, D, S, R and P

By editor 6 min read
Sequential function chart with a Fill step and an action block using L T#5s to run a pump

The L qualifier in a Sequential Function Chart (SFC) is a time-limited action: it starts when the step becomes active and stops when its time expires or the step deactivates, whichever happens first. For example, L T#5s runs an action for up to 5 seconds. L is one of the IEC 61131-3 action qualifiers, and L, D, SD, DS and SL all require a time value.

QualifierNameWhat the action doesTime?
None / NNon-storedRuns while the step is activeNo
SSet (stored)Runs until reset by RNo
ROverriding resetEnds a stored actionNo
LTime limitedRuns for up to the set time while the step is activeYes
DTime delayedStarts after the delay if the step is still activeYes
PPulseExecutes when the step activatesNo
SDStored and delayedStarts after the delay even if the step has endedYes
DSDelayed and storedStores only if the step lasts for the delayYes
SLStored and limitedStarts and runs for the set time unless resetYes
P1Pulse, rising edgeOne pulse when the step activatesNo
P0Pulse, falling edgeOne pulse when the step deactivatesNo
IEC 61131-3 action qualifiers, based on PLCopen and PLCnext documentation.
Safety first: Test sequence changes offline or in simulation first. A wrong qualifier can leave an output running after a step ends. Do not use standard SFC logic as a safety function.
5
Qualifiers need a TIME
L
Time limited
.X
Step active flag
.T
Step elapsed time

How an SFC Action Block Works

SFC action blockAn action block attached to a step contains the L qualifier, a five second time and the RunPump action.Parts of an SFC action blockFillStepLQualifierT#5sTimeRunPumpActionStepIndustrialBasicsindustrialbasics.com
Figure 1: L T#5s runs RunPump for up to 5 seconds while FillStep is active.

A Sequential Function Chart breaks a process into steps and transitions. Actions attached to a step say what happens, and each action’s qualifier says when. SFC is one of the languages described in our IEC 61131-3 guide.

Each step also has two useful variables. Step.X is true while the step is active, and Step.T is its elapsed time. A transition can use them, for example FillStep.T >= T#30s.

The L Time-Limited Qualifier

L starts the action when the step becomes active and keeps it running for the set time, provided the step remains active.

Step active forL T#5s action runs forWhat ended it
8 s5 sTime expired
5 s5 sTime and step end together
2 s2 sStep deactivated
Examples for L T#5s, ignoring scan time.

PLCopen shows that L behaves like an N action that checks the step time:

N  Ax

ACTION Ax:
    IF Sx.T <= T#5s THEN
        Num := Num + 1;
    END_IF;
END_ACTION
Reader tip: Depending on the implementation, the comparison at the exact limit may be <= or <, so do not rely on one extra scan at the time boundary.

Compare the Time Qualifiers

SFC time qualifier timingTiming for N, L, D, SD, DS and SL with a three second time. When the step lasts longer, D starts after the delay. When the step is shorter, D and DS never start, while SD still starts and SL runs for its full time.Action timing with a 3 s qualifier timeStep active longer than the timeStepNLDSDDSSLRStep active shorter than the timeStepNLDSDDSSLRIndustrialBasicsindustrialbasics.com
Figure 2: Orange bars show when the action runs. R marks a reset of stored actions.
QualifierIf the step lasts longer than the timeIf the step ends early
LStops when time expiresStops with the step
DStarts after delay, stops with stepNever starts
SDStarts after delay, runs until resetStill starts after delay
DSStarts after delay, runs until resetNever starts
SLRuns for the timeStill runs for the full time
How step duration changes the result.

The difference between SD and DS catches many programmers out. With SD, activation alone commits the action to start later. With DS, the step must still be active when the delay ends.

Stored Actions: S and R

An S action keeps running from the step where it is set until a step with the same action qualified R becomes active. It can shorten a chart, but PLCopen’s SFC guidance advises against S and R because they make the execution range harder to understand. Paths containing only the S or only the R can cause serious testing and maintenance problems.

If you do use them, keep the stored range short and avoid putting a divergence between the set and reset.

Pulse Qualifiers and the Final Scan

P executes once when the step activates. P1 and P0 give clear rising and falling edge pulses, so use them where your platform supports them.

Be careful about what happens after a step ends. PLCopen notes that a final scan of the action is implementation specific, and PLCnext documents a FINAL_SCAN option that changes how P behaves. Published descriptions of plain P also differ at deactivation, so check your own controller’s manual.

Worked Example: Tank Fill

StepActionQualifierWhy
FillStepOpenValveNValve is open only during filling
FillStepFillAlarmTestP1Runs once on entry
FillStepBoostPumpL T#5sRuns for at most 5 s
FillStepLowFlowCheckD T#10sChecks flow only after 10 s
MixStepRunMixerNRuns only during mixing
Illustrative qualifier choices for a simple batch sequence.

Here, LowFlowCheck uses D because flow needs time to settle. If the fill finishes in under 10 seconds, the check never runs. Avoiding S keeps every output tied to a visible step. For PLC project basics, see what a PLC is, and for mapping real signals into logic, see our I/O tag guide.

Safety note: Syntax, supported qualifiers and final-scan behavior vary by platform. Confirm them in your programming software’s documentation.

Frequently Asked Questions

What does the L qualifier mean in SFC?

L means time limited. The action starts when the step becomes active and stops when the time expires or the step deactivates, whichever comes first.

What is the difference between L and SL?

L stops if the step deactivates. SL is stored, so it continues for its full time even if the step ends, unless it is reset first.

What is the difference between D, SD and DS?

D runs only while the step stays active after the delay. SD stores the action and starts after the delay even if the step has ended. DS starts and stores only if the step lasts for the delay.

What is the difference between N and S?

N runs only while the step is active. S stays active after the step ends until an R qualifier resets it.

Which SFC qualifiers need a time?

L, D, SD, DS and SL require a TIME value.

What do P, P1 and P0 mean?

P is a pulse when the step activates. P1 is a pulse on the rising edge of step activation and P0 is a pulse on the falling edge.

What are stepname.X and stepname.T?

X is the step active flag. T is the elapsed time since the step became active.

Should I use S and R qualifiers?

Use them sparingly. PLCopen advises against them because stored actions can make programs harder to read, test and maintain.

Sources and Further Reading

About the author

editor

Leave a Comment