Join us today!

Notifications
Clear all

Totalizer

12 Posts
4 Users
3 Reactions
590 Views
Posts: 5
Topic starter
(@djdhendoehei3hd)
Active Member
Joined: 2 years ago

Is there a way to do a totalizer in TwinCat 3 PLC? I can't seem to even find math functions to do it (without resorting to C++/MatLab.

This totalizer would be similar to the TOT function in an Allen Bradley PLC for totalizing flow meters such as from an analog input. The analog input would be a flowrate (such as gallons per minute). I would then totalize over a given period of time (such as total gallons per day) and send commands to have it reset. The built in blocks typically proivde better control over the time than trying to do it manually. 

Any thoughts?

Reply
11 Replies
3 Replies
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@djdhendoehei3hd ,

Can you give an example or a link of what you want?...

Reply
(@djdhendoehei3hd)
Joined: 2 years ago

Active Member
Posts: 5

@runtimevictor 

Thanks. I edited my original post to be more specific. 

Reply
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@djdhendoehei3hd ,

https://theautomationblog.com/controllogix-function-block-totalizer/

Is this what you mean? Is there something similar in TwinCAT?

Reply
Posts: 5
Topic starter
(@djdhendoehei3hd)
Active Member
Joined: 2 years ago

That is correct. I'm mainly just looking for a flow totalizer that takes in an analog input and an accurate base time. Sometimes home made totalizers can get off if the correct timing reference isn't used. Built in ones take that into account. 

Reply
2 Replies
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@djdhendoehei3hd ,

If you don't want to have a scan cycle time error, which is normally 10 milliseconds, you can read the system time and subtract it with the next cycle, with this you won't lose anything,
As far as I know, there is no function similar to the one to search for by Allen Bradley from Totallizer TOT, you can look in the OSCAT library to see if it exists, you also have
https://github.com/RWTH-EBC/AixOCAT
I have seen that TwinCAT has some totalizer but it is for the TF8020 library | TwinCAT 3 BACnet,
A good exercise would be to do it yourself with the same inputs/outputs as the TOT you use by Allen Bradley, if you want to do it I can tell you how you can count the time without any loss...

Reply
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@djdhendoehei3hd ,

Hello,
I'll hit you with this FB, which is the one that I have developed, how to tell time, you would have to adapt it and change it so that it works like Totallizer (TOT) with inputs and outputs like Allen Bradley's, if you develop it I would like you to post it here like this I can see it:

FB StopWatch Level
Reply
rruiter
Posts: 63
(@rruiter)
Estimable Member
Joined: 2 years ago

If I understood it correctly, you're looking for a cumulative rolling sum. There is not build in function as far as I know, so you would have to construct your own.

Reply
Posts: 30
 Alex
(@alex)
Eminent Member
Joined: 2 years ago

Move this topic to the ''PLC Programming Challenge'' 🤔 

Reply
3 Replies
(@djdhendoehei3hd)
Joined: 2 years ago

Active Member
Posts: 5

I wasn't originally anticipating this becoming a programming challenge. . . 

Reply
runtimevictor
(@runtimevictor)
Joined: 2 years ago

Estimable Member
Posts: 156

@djdhendoehei3hd ,

Have you seen the photo that I have given you?, with this there is no waste of time, you already have where to start and you can do exactly what allen bradley has with totallizer (TOT) with the same inputs and outputs, but since you do it, improve it with an OOP approach, methods, properties, etc..

Reply
(@djdhendoehei3hd)
Joined: 2 years ago

Active Member
Posts: 5

Yes! It was very helpful. Thanks!

Reply
Share: