Tank lever using LOGO! PLC

Hello i am new in the forum and i am making a personal project using the maker edition and i am needing to calculate the quantity of liters poured. i am already reading the analog value of the tank level trough a logo plc. the question is how can i make a reading of the value of the tank level each second and sustract those values to get the different of high of the tnk. i repeat i have the analog reading in ignition

You could use historian and log the value every second. Or log on change to reduce filling the database when not in use.

Right click on your tag in the designer, edit tag and enable history. Once you have the values in the database you can manipulate the data anyway you want.

If you have a trigger on when the pour starts and stops it will be easier.

1 Like

Thanks for answering, now i have the data in my database each second, can you help me to manipulate that data so i can make the sustraction, is direct in ignition or in mysql? i need H1(t) - H1(t=t+1) each second

This is a really bad idea. Differentiation is error prone and tends to be noisy. Simply snapshot the tank quantity when you start, then compute quantity versus that snapshot as the level changes. No need to involve time.

I have a flow meter at the tank inlet and a level sensor and I need to measure the number of liters coming out of the tank and create a record

Integrate the flow meter to quantity and add to the tank’s last quantity. Then compute change in quantity when the level value arrives. Divide the change by the actual time seconds from the last level sample.

{ Record both inlet flow and tank level to your database. Then you can reconstruct outlet flow at any time. }

Great thats the proccedure i have in paper so now i have to learn how to apply that to the ignition using mysql. i am new in this great softwares, please sorry for be annoying.

How are your “pouring”?. Manual value, auto valve etc ? Just thinking that if it’s auto you have a way of knowing when your pouring, even if it’s manual you can add switches.

I have both (manual and auto pouring) but the idea is count the liter going out the tank, so trough the flow meter and with the level sensor of the tank i have to sense the quantity of the liters like said pturmel but i need coding that