You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old January 3rd, 2018, 03:43 PM   #1
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
Need Help with M3/Hour Totalizer

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
__________________
Waste Water Automation and Control
  Reply With Quote
Old January 3rd, 2018, 03:49 PM   #2
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
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?
__________________
Waste Water Automation and Control

Last edited by sparkytex; January 3rd, 2018 at 03:52 PM.
  Reply With Quote
Old January 3rd, 2018, 03:59 PM   #3
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,411
Quote:
Originally Posted by sparkytex View Post
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.
__________________
  Reply With Quote
Old January 3rd, 2018, 04:03 PM   #4
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
Quote:
Originally Posted by Bit_Bucket_07 View Post
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.
__________________
Waste Water Automation and Control
  Reply With Quote
Old January 3rd, 2018, 04:03 PM   #5
harryting
Lifetime Supporting Member
United States

harryting is offline
 
harryting's Avatar
 
Join Date: May 2002
Location: Puget Sound
Posts: 1,867
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.
  Reply With Quote
Old January 3rd, 2018, 04:04 PM   #6
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,411
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).
__________________
  Reply With Quote
Old January 3rd, 2018, 04:08 PM   #7
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,411
Quote:
Originally Posted by sparkytex View Post
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
__________________
  Reply With Quote
Old January 3rd, 2018, 04:15 PM   #8
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
Quote:
Originally Posted by Bit_Bucket_07 View Post
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.
__________________
Waste Water Automation and Control
  Reply With Quote
Old January 3rd, 2018, 04:17 PM   #9
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,411
Quote:
Originally Posted by sparkytex View Post
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.
__________________
  Reply With Quote
Old January 3rd, 2018, 04:29 PM   #10
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
Quote:
Originally Posted by Bit_Bucket_07 View Post
Well then, rounding errors from machine epsilon shouldn't be a concern. It often is a concern when doing totalization.
Yes I could see it becoming a problem with a large number for sure. Thank you!
__________________
Waste Water Automation and Control
  Reply With Quote
Old January 3rd, 2018, 04:39 PM   #11
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
Quote:
Originally Posted by Bit_Bucket_07 View Post
Great Video, thank you for the help it's much appreciated. Happy new year!
__________________
Waste Water Automation and Control
  Reply With Quote
Old January 3rd, 2018, 05:07 PM   #12
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
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?
__________________
Waste Water Automation and Control

Last edited by sparkytex; January 3rd, 2018 at 05:12 PM.
  Reply With Quote
Old January 3rd, 2018, 05:20 PM   #13
cyoung120
Member
United States

cyoung120 is offline
 
Join Date: Jul 2013
Location: OH
Posts: 26
There is a totalizer instruction in Function Block that works well
  Reply With Quote
Old January 3rd, 2018, 05:35 PM   #14
sparkytex
Lifetime Supporting Member
Canada

sparkytex is offline
 
sparkytex's Avatar
 
Join Date: Jun 2013
Location: Port Hardy B.C.
Posts: 297
Quote:
Originally Posted by cyoung120 View Post
There is a totalizer instruction in Function Block that works well
Unfortunately this program is all ladder logic
__________________
Waste Water Automation and Control
  Reply With Quote
Old January 3rd, 2018, 05:37 PM   #15
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,411
Quote:
Originally Posted by sparkytex View Post
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.
__________________
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Need Help making a totalizer for a flow transmitter sparkytex LIVE PLC Questions And Answers 9 January 15th, 2014 12:46 PM
Logix 5000 Totalizer Function Block dtlegrone LIVE PLC Questions And Answers 5 November 24th, 2013 08:02 AM
Product Totalizer Logic using Siemens S7-300PLC Coulombboy LIVE PLC Questions And Answers 1 July 6th, 2012 03:17 AM
Update Totalizer In Both Cpu sanjay_snj LIVE PLC Questions And Answers 2 May 29th, 2005 03:15 AM
Totalizer feedback from Rosemount Flowmeter iknowsomeplc LIVE PLC Questions And Answers 0 April 25th, 2002 12:47 AM


All times are GMT -5. The time now is 03:11 AM.


.