We ship a small dosing skid, CompactLogix 5069-L306ER, V33. Last month I converted the fill and dose sequence from ladder state bits over to an SFC.
Now valve XV101 stays open after the fill step exits, right through the dose step, until the drain step writes it off. Two valves overlap for about 4 seconds and the customer spotted it on the flow trend. Each step has one action with the valve OTE inside it, and I can watch the fill step go inactive online while the OTE sits there on.
I tried an OTU on XV101 in the first rung of the dose action and that does work, but then every step needs an OTU for every other valve, which can't be how anyone does this.
Is SFC just not suited to valves, or am I missing something?
Controller Properties, SFC Execution tab. What's Last Scan of Active Steps set to? Don't scan is the default if I remember right.
Don't scan. I've never opened that tab, so that's my own default rather than a decision. What do the other two options do?
Every SFC dialect answers this differently. CODESYS drops an N qualifier action's outputs when the step deactivates. GRAPH on the Siemens side does the same without asking. Logix leaves it to that setting. None of them is wrong, you just have to know which one you're in.
The way that works on all three, and the one maintenance can read without the chart open: no OTEs inside the actions at all. The chart only sets step bits. One ladder routine says XV101 = Fill.X AND NOT Level_Hi. Every output has one owner and one rung.
Set it to Automatic reset. On the last scan of a step that's going inactive, Logix runs the action once more as a postscan, OTEs go off and timers reset, so XV101 drops the same scan the step leaves. Programmatic reset gives you the step's LS bit for one scan and you do the clearing yourself. Don't scan leaves whatever was there, which is what you've got.
Kai's way is cleaner and I do the same on bigger machines. For a dosing skid, automatic reset gets you out of it today. There's a writeup on SFC here: https://plctr.com/implementing-sequential-function-charts-sfc-in-plc-programming/
Automatic reset, download, XV101 drops the moment the fill step exits. Overlap's gone off the trend and the OTUs are out of the dose action.
So it was a setting I'd never opened. SFC Execution sat on Don't scan, which is the default and therefore my default, and an OTE inside an action just keeps its last state when the step goes inactive. Controller Properties, SFC Execution, Last Scan of Active Steps, Automatic reset, and the valve drops with the step.
One thing it didn't do that I'd assumed it would: an OTL I use for a batch-in-progress bit is untouched by the reset, only the OTEs and the timers come off. I clear that one myself now. Not sure what else in an action survives it. Thanks jcasey and kaim.
Tagged this one with the SFC Execution setting so it turns up in search.