Studio 5K Function Block Totalizer

This is very confusing because by rights ...
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.

The point of the axiom is:
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.
 
In my experience, those thing right in front you can't see

Walk away for about an hour, get your mind off it.

When you come back it will be right there.
 
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?
 
Last edited:
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.


It's working now. Not sure how I missed this

thanks for the help.
 

Similar Topics

Please see attached file. I need this program in Function Block form but I am totally lost on this. Any help would be appreciated. Thanks!
Replies
8
Views
298
I am trying to setup the TOT function block so that I bring in GPM and want to output MGD. I cannot seem to figure out the correct gain in the...
Replies
16
Views
2,718
Am I losing it? Is it not possible to COP a UDT to another UDT in a function block routine? PLEASE HELP!
Replies
4
Views
1,542
Hi there, I have been using ladder logic for quite some time on a variety of AB products. I've switched to function block for a lot of things...
Replies
7
Views
2,749
I have been developing a program on studio 5000 in function block. I exported the program section from one computer to another. The function block...
Replies
2
Views
2,236
Back
Top Bottom