I need to monitor the very slow drop of an oil level as the oil is consumed by a process. It will ocnsume the oil, it is supposed to.
I have a block now that samples the oil level every X time period and puts this value in a memory location.
As it moves the data to a new location, it compares the two last readings and gives the difference as the oil drop in that time period.
It then would compare each new oil drop to the first oil drop to see if we are using more or less now than when we started. Like a very rough trend.
I am using sample00 as the standard reference and then take 2 more samples 01 and 02 and then just overwrite the previous one and redo the compare .repeat forever.
I am getting to the point where I would like to do an average of more than just the last 2 or 3 readings.
Maybe take a reading every minute and then average them for the hour and day and week. And then I could display this rough trend on the HMI.
I think the best way to do something like this would be a table like in SQL.
Just keep adding new readings to the top and let the old numbers shift down and then out.
The average would always be updated.
I see how this would work in my head , but not translated into S7.
Does this sound reasonable?
Any ideas on how to do this S7?
I am going to look for a FC that might help, I thought I saw a database like table function somewhere.
I have read through several posts in an effort to find something like this.
I have a block now that samples the oil level every X time period and puts this value in a memory location.
As it moves the data to a new location, it compares the two last readings and gives the difference as the oil drop in that time period.
It then would compare each new oil drop to the first oil drop to see if we are using more or less now than when we started. Like a very rough trend.
I am using sample00 as the standard reference and then take 2 more samples 01 and 02 and then just overwrite the previous one and redo the compare .repeat forever.
I am getting to the point where I would like to do an average of more than just the last 2 or 3 readings.
Maybe take a reading every minute and then average them for the hour and day and week. And then I could display this rough trend on the HMI.
I think the best way to do something like this would be a table like in SQL.
Just keep adding new readings to the top and let the old numbers shift down and then out.
The average would always be updated.
I see how this would work in my head , but not translated into S7.
Does this sound reasonable?
Any ideas on how to do this S7?
I am going to look for a FC that might help, I thought I saw a database like table function somewhere.
I have read through several posts in an effort to find something like this.