Morning,
TIA V17, CPU 1511-1 PN, KTP900, a mixer skid we shipped in the spring. The batch sequence is a CASE on an integer Step in SCL, 18 steps. E-stop drops the safety relay, the PLC sees safety OK go low and sets Step := 0, so after the reset it starts again at step 1, drain and rinse, and the half made batch goes down the drain. The customer's dumped four batches now.
I tried leaving Step alone on the E-stop, and then the mixer carries on from step 12 and the dosing valve opens the moment the relay resets with nobody having pressed anything. A retentive Step does the same.
I never wrote a resume into this program at all. What's the right structure for one? Something that holds at step 12 and waits for somebody to press a button before a valve moves, is that the shape of it?
V17, noted. What tells the sequence it's allowed to move again, the relay reset or the operator? From your post it sounds like the relay. And was a timer mid count when they hit the stop, agitation or dosing?
The relay, at the moment, nothing else. There's no Resume button on the panel because there was never a resume, it was Start or nothing. Agitation, 40 s IEC TON, and it had about 5 s left when they hit the stop.
Whatever the code ends up doing, the relay stays exactly as it is. E-stop drops the contactors and the valve supply through K1 and K2, the PLC never gets a vote on that, and a reset on its own must not restart anything. That's the standard, not an opinion. Once that's true, your resume logic is free to be as clever as it likes.
You want a Held state, ISA-88 calls it that and PackML does too. When safety OK drops, don't touch Step. Copy it to Step_Held, set Step to a Held value, outputs off, timers frozen rather than reset. An IEC TON loses ET when IN drops, so use TONR, it pauses and only clears on R, if I remember the block right.
Resume is an operator action, a button on the KTP900. On Resume, re-check the held step's own conditions first, level, agitator speed, valve feedback, and only then Step := Step_Held. Abort goes to drain. Held, Resume, Abort, three transitions in the same CASE that owns Step. Longer version with the states: https://plctr.com/utilizing-plc-for-batch-process-control/
Held state done. Step 99 is Held, Step_Held keeps the real step, all outputs off, agitation timer moved to a TONR. Resume button on the KTP900 re-checks the step's conditions, then Step := Step_Held. Abort goes to drain. Tested 20 stops on a water batch, carried on every time, and nothing moved on the relay reset alone.
Root of it was the sequence having no held state at all, the stop just reset the pointer. That's on me, I left it out because the spec never mentioned it.
Customer's added one thing since: after a hold longer than 30 s they want the full 40 s agitation again, not the remaining 5. I'm adding that. Still not sure whether Resume should need the supervisor login. Thanks priya87, ronh55 and sanjay12.
Confirm it once more on a real batch, then I'd call it closed.