Suggestions-Total spent last 24 hours

Hi.

I wonder if somebody has one suggestion as to what is the best way to find out how much a value has increased in the last 24 hours.
Scripting, transaction groups or something completely different?

I have never used transaction groups in ignition and are new to programming so I will be grateful for all suggestions.

Thanks in advance.

If you want to compare a current value with a previous value you are going to have to log the value. You can do this with either transaction groups or tag history - which you will use depends on what you are trying to do.

You’ll need to give us some more information: do you need to continuously compare the value to what it was 24 hours ago, or do you want to show increase from a fixed time like midnight?

Hi @AlThePal

I will try to explain what I want

I have a tank filled with about 6l of water each day. If it enters more than 6l in the last 24 hours, I want it to generate an alarm.

I would have thought you would want to alarm either on absolute water level or on volume flow into the tank. If you do it on water levels, how are you going to cope with outflow from the tank?

The High level sensor takes care of absolute level and I do not have a flow meter.
The tank is filled to the maximum level and emptied, but this may take 2 weeks. So there is no outflow before it is emptied.

Is it possible to see daily level increase?

If you are interested in seeing a trend, I would record the data by turning on Tag History. You can then run a gateway script to return the value of the tag 24 hours ago using the system.tag.queryTagHistory call and write the difference between then and now to another tag which has an alarm on it.

1 Like

Thank you @AlThePal I will try that.