Tag History - Local Maxima for Resettable Totalizer

I’ve got a few totalizer tags in my project that are being logged in tag history currently. I want to include these on a report for a given time range to show the total value for a specific time range. 99% of the time, I can just subtract the totalizer value at the start time from the totalizer value at the end time and it will be correct. My problem is that the user has the ability to reset the totalizer, so this will be inaccurate if they have reset the totalizer within the time range that they are pulling up the report.

What I’m thinking is that I can pull the full history of the totalizer and extract the local maxima to calculate the “total” piece-wise. For example: if totalizer value starts at 50, goes to 100, is reset to 0, then goes to 150 – I would find the local maxima of 100, so I could do (100-50)+(150-0) = 200. Thing is, I can’t find a good way to get the local maxima of a dataset in scripting (seems like numpy does not work in Ignition).

  1. Is there a way to find local maxima of a dataset in scripting?

  2. Or is there a better way to track and report totalized value over a variable time range?

1 Like

@dan123
Did you find a solution to this?
How are your few totalizer tags totalizing? Ignition scripting or PLC logic or?