The process and instrumentation diagram (P&ID) of a single tank for level control is shown in the Figure. As shown in the figure, the tank's top is open, and its purpose is to manage the liquid level. It blocks the outlet flow when the liquid reaches the low level and allows the inlet flow until the high level is attained. Once the high level is reached, the outlet flow is permitted, and the inlet flow is blocked. Thus, two level sensors, LLS and HLS, are installed at the bottom and top of the tank to detect low and high levels.
In the PLC ladder diagram shown in the figure, the first rung is responsible for latching a coil and master start-stop buttons. The second rung controls the Outlet Valve by detecting the HLS. The output valve is latched to keep the Outlet Valve open until the LLS is detected. The last rung works similarly - when the LLS is detected, it opens the inlet valve until the HLS is detected again. The inputs for this program include Start, Stop, LLS and HLS. The outputs are the Inlet Valve and Outlet Valve. All these variables are defined in the figure. Users can initiate the simulation by clicking the "Start Simulation" button at the screen's top right corner.