When you are using structured text for PLC programming, it helps a lot in saving time and decoding the logic easily. It requires a good knowledge of syntax and instruction format. Once written, you can write the complex logics easily.
One system which is used widely in many processes is controlling the level of two tanks. Because tanks are used in many applications, it must be understood to write the logic properly. In this post, we will see how to write a PLC program for controlling the level of two tanks using structured text.
Structured Text for two-tank level application
Let us understand the case scenario first. Refer to the below image. There are two tanks in the system. Both the tanks have two level switches (/sensors) each – low and high.
The first tank is filled by a valve. The second tank is drained by a valve. In between the two tanks, another valve which drains the first tank as well as fills the other tank.
When any level is low, then the drain valve will remain closed. When any level is high, then the filling valve will remain closed. The valve remains closed as long as the level is not healthy; once healthy, then it will open again.
Structured Text PLC Programming
Now, let us see the logic to be written. As we are using structured text, we will use simple if-else statements for understanding it.
Refer to the below image. There are four PLC inputs – tank-1 level high, tank-1 level low, tank-2 level high, and tank-2 level low.
There are three PLC outputs – valve-1, valve-2 and valve-3.
First, we will see how to fill tank-1. If the level of tank-1 is high, then the valve will remain off. So, we used an if-else statement where, if the value of the sensor is zero, it means the level is normal and the valve output will be written as 1. Else, it will be written as 0.
Now, we will see how to fill tank-2 and drain tank-1. If the level of tank-2 is high or the level of tank-1 is low, then the valve will remain off. So, we used an if-else statement where, if the value of both the sensors are zero, it means the level is normal and the valve output will be written as 1. Else, it will be written as 0.
Now, we will see how to drain tank-2. If the level of tank-2 is low, then the valve will remain off. So, we used an if-else statement where, if the value of the sensor is zero, it means the level is normal and the valve output will be written as 1. Else, it will be written as 0.
Due to this logic, the valves control the level of the tanks and avoid them from being overfilled or the drain valves remaining open unnecessarily in case of empty-tank. The valves work in tandem with each other and thus control the levels of both the tanks.
In this way, we saw how to write a PLC program for controlling the level of two tanks using structured text language.
Read Next:
- Inside the PLC Control Panel: Test Quiz
- Which Language is Best for PLC Programming?
- Exhaust Fan Control: Example of PLC Timer Logic
- PLC Program to Drain Products from Two Tanks
- Automation Solutions Logic for Stairway Lighting
The Process explanation has to be like this as follows:- Initial Condition: LLST1 & LLS T2 should be ON. When Push button Start (Pb Start) is pressed ON, Motor ON.
When HLST1 becomes ON, Motor becomes OFF & V1 gets ON. Then so on. If you need the details of this whole Process kindly, message in this. Thank you