News:

  • May 03, 2024, 04:48:07 AM

Login with username, password and session length

Author Topic: Flow Totalizer  (Read 7477 times)

hex1

  • Jr. Member
  • **
  • Posts: 13
Flow Totalizer
« on: October 10, 2017, 01:44:41 AM »

Hello everyone,

I want to build a Flow totalizer program (never done it before) using the Domore PLC.
Can I get some pointers or a sample program?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Flow Totalizer
« Reply #1 on: October 10, 2017, 05:08:04 AM »

Hello everyone,

I want to build a Flow totalizer program (never done it before) using the Domore PLC.
Can I get some pointers or a sample program?

Simple with BRX. Get unit with DC input, hook up sensor to a high-speed input, configure high-speed counter on that input, and make it retentive.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

hex1

  • Jr. Member
  • **
  • Posts: 13
Re: Flow Totalizer
« Reply #2 on: October 10, 2017, 12:44:32 PM »
Thanks, will check the flow meter for pulse out put.
Second scenario:
Flow totalizer with 4-20ma Output.
Just want to make sure I can prepared for whatever output is present.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Flow Totalizer
« Reply #3 on: October 10, 2017, 01:08:38 PM »
When using analog, choose a sampling period and once a period, take the instantaneous flow rate, multiply by the period length and add to the total.  Shorter periods will be more accurate because the method assumes that the flow is constant throughout the entire period.  In some scenarios you must compensate for scan latency.  Say you have a 500ms recycling timer in a program with a scan time of 6ms.  If you just let the timer recycle itself with an NC DN bit on the input, then on average, your timer will recycle every 503ms (500 + 6/2).  So if you want it to be accurate, you can do a couple things.  If there's an internal flasher bit near the period you want to use, say the one second ST4 bit, use a differential of that, as there's no accumulated error, or instead of simply recycling the timer, you can subtract the nominal period length from the timer accumulator (don't think I've actually tried this with Do-More, so I don't know if it will let you manipulate the timer accumulator).  That way, when you see the timer has expired, on average at 503ms, and you subtract 500ms from it, you have a 3ms head start on the next cycle, or 1/2 scan, which eliminates the error due to scan time latency.
« Last Edit: October 10, 2017, 01:12:11 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Flow Totalizer
« Reply #4 on: October 10, 2017, 02:01:46 PM »
Or could just use the INTEGRATE instruction.

But yes, the .Acc field can be manipulated.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Flow Totalizer
« Reply #5 on: October 10, 2017, 04:22:40 PM »
Well sure, but that's like sitting down and just typing without first building your own typewriter from ore you mined and smelted yourself.  Where's the fun in that?
« Last Edit: October 10, 2017, 07:38:52 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Flow Totalizer
« Reply #6 on: October 10, 2017, 07:19:28 PM »
Are you by chance an engineer? ;)
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Flow Totalizer
« Reply #7 on: October 10, 2017, 07:35:06 PM »
I've been accused of it!   ;D

Little Dilbert's going to be an engineer:  https://www.youtube.com/watch?v=j0ASj8R7wp4
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Garyhlucas

  • Hero Member
  • *****
  • Posts: 400
Re: Flow Totalizer
« Reply #8 on: October 10, 2017, 08:29:24 PM »
I got caught taking apart the alarm clock.  Dad said "Gary did you take apart the alarm clock?"  I said "Doesn't it work?"  Dad said "Yes it works, but it was riveted together and now it has bolts!"  Note to self, need rivets and rivet gun.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Flow Totalizer
« Reply #9 on: October 10, 2017, 08:41:42 PM »
My dad once gave me a drill that no longer worked, so I took it apart and put it back together.  Didn't knowingly fix anything, just took it apart and put it back together, and it started working!  So then he wants it back, but you know, a gift's a gift.....
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5991
  • Yes Pinky, Do-more will control the world!
Re: Flow Totalizer
« Reply #10 on: October 11, 2017, 03:50:33 AM »
Take it apart. Clean it. Lube it. And reassemble. Doesn't everyone do that? ::)
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Flow Totalizer
« Reply #11 on: October 11, 2017, 11:04:38 AM »
Absolutely!  I tried that on a 260, hoping to get it to run like a Do-More.  Didn't seem to help.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3665
    • Host Engineering
Re: Flow Totalizer
« Reply #12 on: October 11, 2017, 01:12:34 PM »
Absolutely!  I tried that on a 260, hoping to get it to run like a Do-More.  Didn't seem to help.
You needed to fix DirectSOFT also.  Just reverse compile the DSP.EXE and rewrite the code. ;D

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3561
  • Darth Ladder
Re: Flow Totalizer
« Reply #13 on: October 11, 2017, 02:34:03 PM »
Ah, should have known!  Elbow deep in a machine right now, but I have a 10 minute break later, I'll do that then.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3665
    • Host Engineering
Re: Flow Totalizer
« Reply #14 on: October 11, 2017, 02:35:40 PM »
Jeff Goldblum in The Fly, pulling an all-nighter to write the code on how to deal with "skin".