Never forget this axiom of programming: the PLC cares not a whit what we want it to do, but it will mercilessly and inexorably do exactly what we tell it to do, according to its programming.
Frustrating yes, confusing no, if we make the reasonable assumptions* that the TOT instruction does actually work when configured properly, and the PLC and Studio4k are operating as designed.
* TBF, remember those assumptions: maybe the instruction is broken and no one uses it (e.g. this thread); or maybe the PLC is broken somehow. But those are low-probability scenarios. I've been programming for four decades and discovered one compiler bug in my career, and that was in the last few years. Early on I was naive enough to have several times when I thought I had found one, but it was always something right in front of me, which I had done or failed to do. So my money, and diagnostic effort, is always on something subtle, or just missed, that will resolve issues like this.
I'm actually working on a TOT at the moment.
After Target, Set to 10Billion
All the data points are set to 0 except:
ProgStart request
RTS Time and
Enable out
These aren't programmed with a tag, they are set to 1 in data table
**I see your's is set the same. Hmmm mine works. Frustrating no?
Ok--here's the deal.
I added a multiplier in the gain parameter. First I just tossed in a 2.0 and it started totalizing but the number was wrong. I throttled my flow down to I gpm and timed it and 1.0 is the answer.