News:

SMF - Just Installed!

Main Menu

Tank: How to create a level switch

Started by cli13_emich, March 05, 2026, 07:02:51 PM

Previous topic - Next topic

cli13_emich

Hello everyone!

I am trying to create a level switch using the built-in tank. By creating a customized controller using "get level", I can toggle it on when the liquid level is over the switch. However, I can't find a way to turn it back off if I drain the liquid back below the switch.

Any help would be greatly appreciated!

EasyPLC_Master

With the 'GetLevel' controller, you can determine the tank's volume in liters.

You can assign this controller's output to an analog input on the PLC or to a variable you create within the controller itself. Then, using the graphical code or script, you simply need to check if the value of the analog input or the variable exceeds a certain threshold to activate or deactivate the necessary condition.

cli13_emich

Thank you for your reply!

A clarification to my question: I already sent the value to a variable and it's able to activate once the level meet the condition. However, it doesn't deactivate once the condition doesn't satisfy any more. Once it's turned on, it stays on no matter what happens next. That's where I am stuck at this moment.

Thanks!

EasyPLC_Master

There must be some error in your code/logic.
Can you share it so we can see where the problem is?

cli13_emich

Of course! Please see attached files for the simple machine I made for this debugging purpose. I also attached the Logix file I used for PLC operation using the emulator (in a link).  Logix Program File

In this example, once the tank fills to 300 liters, the drain gets activated. However, the drain doesn't turn off once tank level falls back below 300 liters.

Thanks!

EasyPLC_Master

You forgot to add the controller to reset the condition!:
You cannot view this attachment.

cli13_emich

Thank you!  :o

I originally thought the reset controller shown in the picture would return a "1" once the condition is met.

I tested the reset controller and it works.

Thanks again.