Programming Examples III

Example 6: 

In the next figure we want to fill the two tanks with water by a pump. The pump is operating manually by a push-button “Start”. When the first tank becomes full, the circuit should automatically start to fill the second tank by closing the first valve, and opening the second valve, and when the second tank is full, the pump disconnects automatically and a “sign lamp” is turned on to show that 2nd tank is full.

We need first to identify the inputs and outputs of the system, so we can set relations between the outside world and the inputs/outputs of the programmable logic controller.
This table makes it clear: (remember NC: normally closed, NO:normally open)

.. and here is the ladder diagram and instruction list for the system: