So I am writing a PLC code in SCL language and I am wondering about this thing:
I have a tank with an inlet and a pump for flow out. The pump should only run after the level in the tank goes beyond a level, lets say 10 meters. And it should keep going until the tank level goes down to 4 meters.
Not sure if I should use more IF statements or maybe a WHILE statement?. Problem is, how to keep the pump going after the level has gone under 10 meters but not yet reached 4 meters?
This code would probably not be useful:
IF (TankLevel > 10) THEN
StartPump := TRUE;
END_IF;
Any help is appreciated.