Appearance
Sequential Function Charts (SFC)
Last updated
License feature: Sequential Function ChartsA Sequential Function Chart describes a sequence: the machine is in a step, and a transition is the condition that moves it to the next one. Where ladder needs a page of latches to say "fill, then wash, then drain", a chart is the drawing of it.
An SFC is a kind of routine, in the same task and program as ladder routines, using the same tags. Choose Add SFC Chart in the routine list and give it a name (SFC chart name:). It needs the Sequential Function Charts license feature as well as Ladder Logic; without it the button is hidden, an existing chart shows Sequential Function Charts are not enabled on this license. The chart can be viewed but not saved., and charts do not scan.
Building a chart
| Part | What it is |
|---|---|
| Step | A state. Its actions run while it is active. The initial step — exactly one, drawn with a doubled border and marked init — is where the chart starts. The first step you add becomes initial |
| Transition | The condition to leave a step, written as an ordinary ladder rung. Select a transition and its rung appears below the chart (Condition — name); add contacts, compares or a TON from the element palette, which appears under the chart palette |
| Selection split / join | A choice: one path is taken. Put the split after a step, leading to transitions; where several are true at once, the link with the lowest priority wins |
| Parallel split / join | Concurrent work: every path starts together. Put the split after a transition, leading to steps; the join waits for every path before its transition can fire |
Drag a step, transition or branch from the palette to where it goes on the chart, or click it to add it below the last node. Link nodes by dragging from the bottom of one to the top of the next. Select a node or link and press Delete (or use the delete button in the panel). Undo and redo (Ctrl+Z / Ctrl+Y, or ⌘Z / ⇧⌘Z) cover every change to the chart and its conditions until you switch routine; a node dragged across the chart undoes in one step.
Steps and transitions must alternate. A link from a step to a step, or a transition to a transition, will not connect.
The panel
| Selected | Fields |
|---|---|
| Step | Name, Make initial step (Exactly one step starts the chart on first scan. Setting a new one clears the old.), Comment, Actions (Add action), Delete step |
| Transition | Name, Comment, the element count or Empty — an empty condition never fires., Delete transition |
| Branch | Kind (switch between the four kinds), Delete branch |
| Link | Priority (Selection branches only — the lowest number wins when more than one path is ready.), Delete link |
The issue bar
The bar above the chart reads Chart is structurally valid or counts Errors and Warnings; click an entry to select the part it is about. It does not stop you saving.
| Errors | Warnings |
|---|---|
| No initial step, or more than one | A step with no outgoing link, or unreachable |
| A transition with an empty condition, or no link in or out | Two steps with the same name |
| A step linked to a step, or a transition to a transition | An action with no routine or no tag |
| A branch in the wrong place | A step that sets a target with S that no step resets with R |
| A tag action pointing at a literal | A split with fewer than two outgoing links, or a join with fewer than two incoming |
| A link to a node that no longer exists |
It also warns when nothing runs the chart (Nothing runs "…").
Actions and qualifiers
An action either drives a boolean tag (Drive a tag) or calls a ladder routine in the same program (Call a routine).
| Qualifier | Behavior |
|---|---|
| N | On while the step is active, off when it is left. Prefer it — it cleans up after itself |
| S | Set: switched on when the step activates and stays on after it is left |
| R | Reset: switches off what an S, SD or DS latched, cancels an SD still timing, and ends an SL early |
| P | Pulse: one scan when the step activates |
| L | Time limited: on while the step is active, but for no longer than its time |
| D | Time delayed: on once the step has been active for its time, until the step is left. A step left sooner never switches it on |
| SD | Stored, then delayed: the step's activation starts the time; when it is up the action latches on — even if the step has been left by then — and stays on until an R |
| DS | Delayed, then stored: latches on only if the step is still active when its time is up, then stays on until an R |
| SL | Stored and time limited: on for its time from the step's activation, whether or not the step stays active, unless an R ends it sooner |
The timed qualifiers (L, D, SD, DS, SL) show a Time (ms) field in the action and the time on the step (such as 2s). A timed action with no time gets a warning in the issue bar, because with 0 it is not timed at all. L and D time from the step's activation, which is reset on a restart of the appliance (as the step time is); a running SD or SL keeps its real start time, so one whose time ran out while the appliance was off has run out — an SL does not come back on, and an SD latches on the first scan.
- S and R pair up on the target — the same tag, or the same routine name — not on the action. The same goes for SD, DS and SL.
- A tag action writes 1 while active and 0 when released, through the same output path as a coil — so the device-tag write limits apply. Drive Local Tags or internal tags.
- A routine action runs that routine on every scan while the action is active (N), once (P), or every scan until reset (S). When the action ends the routine is simply no longer scanned, so coils inside it keep their last values. Use tag actions for outputs that must switch off with the step.
How a chart scans
Each scan that runs the chart:
- On the very first scan, the initial step becomes active.
- Every transition whose preceding steps are all active has its condition rung evaluated, against the step state at the start of the scan. Transitions that are not yet reachable are scanned with no power, so a TON in them resets.
- Transitions that are true fire, lowest link priority first. Once a step has been used by one transition it can't be used by another in the same scan. With equal priorities, which one wins is not something you can control — give each path a different number.
- Steps are left and entered. A chart moves at most one step per scan, even if the next condition is already true.
- Actions run for the steps now active, and the step tags are updated.
Making it run
A chart runs only when its program runs it:
- make it the program's Main routine with the star in the routine list, or
- call it from a ladder rung with a JSR element naming the chart. A contact before the JSR gates the whole sequence — the chart freezes on its step while the contact is off, and its N outputs go off until it is called again.
Watching it — Monitor mode
- The active step is outlined green, with how long it has been active.
- A transition waiting on its condition is amber; it turns green on the scan it fires. Click it to see its rung live and find which contact is false.
- A parallel join shows how many of its paths have arrived (e.g. 1/2), so one slow path is easy to spot.
- Latched S, SD and DS actions, and an SL still within its time, show a green icon; so does any action driving its target on the last scan.
- If the task is running but nothing runs the chart, a banner says so.
Showing the current step on a dashboard
Every chart publishes tags on the appliance's Local Tags device, under SFC/<task>/<program>/<chart>/:
| Tag | Type | Value |
|---|---|---|
step | text | The active step's name — several, comma-separated, while parallel paths run |
step_time | number | Whole seconds since the most recently entered active step became active |
steps/<step> | on/off | On while that step is active — one per step, for a lamp per stage |
A / in any name becomes -. The tags are written only when they change (step_time once a second). They are created when a chart is saved and removed when a step, chart, program or task is renamed or deleted, so a screen bound to a renamed step needs rebinding. They keep showing the held step while the task is stopped. Don't write to them yourself.
Stopping, restarting and resetting
- Stopping the task holds the chart on its step (shown amber, held) and switches off its N outputs. S outputs stay on.
- Starting it again resumes from the same step, driving that step's outputs again. A chart also keeps its place when the routine is saved and when the appliance restarts. Timers do not count the time the task was stopped.
- Chart positions are saved every 10 s while running; after a power cut the chart can resume from a step it had already left in the last few seconds.
- Reset chart (Monitor mode, admin or editor) asks Reset "…" to its initial step? Every output the chart drives, including latched (S) ones, is switched off., then does so. It is recorded in the task log.
- If you delete a step that was active, the chart has no active step and stops moving. Use Reset chart.
Because a chart resumes rather than starting over, make the initial step an Idle step that does nothing. Then a reset never starts a batch by itself. Where you use S, build an abort path to a step that resets it, rather than relying on someone to stop the task.
Example — a three-stage wash
- Steps Idle (initial), Fill, Wash, Drain, with a transition between each and one from Drain back to Idle.
- Idle → Fill: XIC on Local Tags
Washer/StartPB. - Fill: action N, Drive a tag,
Washer/FillValve(Local Tags). Fill → Wash: XICWasher/LevelHigh. - Wash: N action
Washer/Agitator. Wash → Drain: TON, Preset (ms) 300000 (5 minutes). - Drain: N action
Washer/DrainValve. Drain → Idle: XIOWasher/LevelLow. - Star the chart as Main, Save, Run. With a task Washer, program Line1 and chart WashCycle, bind a dashboard value to
SFC/Washer/Line1/WashCycle/step.