Need Help with M3/Hour Totalizer

sparkytex

Lifetime Supporting Member
Join Date
Jun 2013
Location
Port Hardy B.C.
Posts
354
Hey everyone,

I need to make a 24 hour totalizer for the total outfall of treated water to the ocean. There is a Flow meter measuring cubes per hour right now and I need to sample it and create a 24 hour totalizer that will start at 12am and run for 24 hours then send a number to the HMI in which I will have the last 7 days displayed. I need the totalizer to reset every 24 hours at 12 am so the operator can log the outfall total cubes every 24 hours at midnight.

I looked at threads involving totalizers but just want some clarification on this since I'm using a flow meter measuring cubes per hour and my brain isn't functioning well right now brain storming this. I'm using RSLogix 5000 to program this with Ladder Logic.

any help is appreciated.

regards,

Tex
 
Do I just take the address associated with the m3/Hr flowmeter and divide it by 60 for minutes, then divide by 60 again for a cube per second value, then move it into another floating point address and add it into it self every second using a continuous timer set at .1000?
 
Last edited:
Do I just take the address associated with the m3/Hr flowmeter and divide it by 60 for minutes, then divide by 60 again for a cube per second value, then move it into another floating point address and add it into it self every second using a continuous timer set at .1000?

Pretty much, if the flowmeter input is scaled to Engineering Units, rather than being a raw analog input value. You could simply divide one time by 3600. Run the logic under a 1000 ms continuous task, and you won't even need a timer pulse.
 
Pretty much, if the flowmeter input is scaled to Engineering Units, rather than being a raw analog input value. You could simply divide one time by 3600. Run the logic under a 1000 ms continuous task, and you won't even need a timer pulse.

Thanks for the reply, I guess my biggest question is how to reset the totalized value at 12 am every night so the 24 hour totalized value is reset at midnight each night. I know with RSLogix5 you could use status files to accomplish this, I'm not sure how to accomplish this on RSLogix5000 without using a bunch of timers and counters.
 
It's a math problem, right?

Most people would want to tantalize every second, so you need to covert what unit you have to X unit/second then add it to the total.

If you get X unit/hour, covert it to X unit/second by multiplying it by 1 hour/3600 seconds.
 
If you want to avoid rounding errors as your totalizer reaches a large value, then subtract 1000 from your FP totalizer register and add 1 to an integer register every time the FP accumulator is >= 1000, then use a compute function to add the FP totalizer register back to the (INT register x 1000).
 
Thanks for the reply, I guess my biggest question is how to reset the totalized value at 12 am every night so the 24 hour totalized value is reset at midnight each night. I know with RSLogix5 you could use status files to accomplish this, I'm not sure how to accomplish this on RSLogix5000 without using a bunch of timers and counters.

https://www.youtube.com/watch?v=vCrFmo4o7Bs
 
If you want to avoid rounding errors as your totalizer reaches a large value, then subtract 1000 from your FP totalizer register and add 1 to an integer register every time the FP accumulator is >= 1000, then use a compute function to add the FP totalizer register back to the (INT register x 1000).

that average running m3/Hr is only 31 so I don't imagine the FP ever getting above 800 since they rarely introduce more water into the system with their flow control valve.
 
that average running m3/Hr is only 31 so I don't imagine the FP ever getting above 800 since they rarely introduce more water into the system with their flow control valve.

Well then, rounding errors from machine epsilon shouldn't be a concern. It often is a concern when doing totalization.
 
Is there a more accurate way to get the totalizer value? I trended the m3/Hr for half an hour and it never dropped below 30 m3/Hr. I ran a test to see if my totalizer would be close to the average m3/Hr and it was off by quite a bit. For a 30 minute test the totalizer read 13.1 cubes.

Being that the trended m3/Hr shows it never dropping below 30 m3/Hr and ran an average of 31.3 m3/Hr the number over a 30 minute test should be closer to 15.5 cubes. Right now all I have is a continuous running TON timer preset to .1000. That TON timers's .Dn bit is actuating a ONS that's adding the m3/second to itself and storing it as a totalizer value.

Is it the PLC scan time causing this or did I program this wrong?

Edit ** the routine I'm using to house this logic is in a 100ms cyclic task, should I be using a 1 second cyclic task for this totalizer?
 
Last edited:
Is there a more accurate way to get the totalizer value? I trended the m3/Hr for half an hour and it never dropped below 30 m3/Hr. I ran a test to see if my totalizer would be close to the average m3/Hr and it was off by quite a bit. For a 30 minute test the totalizer read 13.1 cubes.

Being that the trended m3/Hr shows it never dropping below 30 m3/Hr and ran an average of 31.3 m3/Hr the number over a 30 minute test should be closer to 15.5 cubes. Right now all I have is a continuous running TON timer preset to .1000. That TON timers's .Dn bit is actuating a ONS that's adding the m3/second to itself and storing it as a totalizer value.

Is it the PLC scan time causing this or did I program this wrong?

Edit ** the routine I'm using to house this logic is in a 100ms cyclic task, should I be using a 1 second cyclic task for this totalizer?

Yes, I'd try running the logic in a one second periodic task. That timer pulse will be inherently inaccurate, and you won't need a trigger in a 1 second task. If you have errors after that, I'd re-check the math.
 

Similar Topics

Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
267
Hello, I am programming in S7-1500, V17. I have some blocks from a drive manufacturer that are not compiling and giving me an error "Invalid...
Replies
2
Views
273
Hi all, I’m new to programming and want to write a simple routine. Push start button, turns on sensor. 2 second delay before anymore logic read...
Replies
1
Views
289
Hi guys, I have no experience when working with AllenBradley PLC, but I hope someone could clarify the result of multiplication shown in the...
Replies
14
Views
2,131
Back
Top Bottom