Host Engineering Forum

General Category => General Discussion => Topic started by: hex1 on October 10, 2017, 01:44:41 AM

Title: Flow Totalizer
Post by: hex1 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?
Title: Re: Flow Totalizer
Post by: BobO 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.
Title: Re: Flow Totalizer
Post by: hex1 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.
Title: Re: Flow Totalizer
Post by: Controls Guy 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.
Title: Re: Flow Totalizer
Post by: BobO on October 10, 2017, 02:01:46 PM
Or could just use the INTEGRATE instruction.

But yes, the .Acc field can be manipulated.
Title: Re: Flow Totalizer
Post by: Controls Guy 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?
Title: Re: Flow Totalizer
Post by: BobO on October 10, 2017, 07:19:28 PM
Are you by chance an engineer? ;)
Title: Re: Flow Totalizer
Post by: Controls Guy 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 (https://www.youtube.com/watch?v=j0ASj8R7wp4)
Title: Re: Flow Totalizer
Post by: Garyhlucas 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.
Title: Re: Flow Totalizer
Post by: Controls Guy 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.....
Title: Re: Flow Totalizer
Post by: BobO on October 11, 2017, 03:50:33 AM
Take it apart. Clean it. Lube it. And reassemble. Doesn't everyone do that? ::)
Title: Re: Flow Totalizer
Post by: Controls Guy 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.
Title: Re: Flow Totalizer
Post by: franji1 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
Title: Re: Flow Totalizer
Post by: Controls Guy 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.
Title: Re: Flow Totalizer
Post by: franji1 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".
Title: Re: Flow Totalizer
Post by: Controls Guy on October 11, 2017, 03:23:51 PM
Jeff Goldblum in The Fly, pulling an all-nighter to write the code on how to deal with "skin".

As a controls guy, I thought the movie had a serious plot flaw.  So he gets teleported and inadvertently spliced at DNA level with the fly.  If you were building that machine, and could process that bandwidth of data, wouldn't you keep a copy?  And if you did, couldn't you go back and sort out fly from guy and reverse the process?
Title: Re: Flow Totalizer
Post by: BobO on October 11, 2017, 04:17:52 PM
And we know Jeff G is brilliant...he wrote a virus to take down an alien ship, and even reprogrammed their displays. Fly DNA? Child's play!
Title: Re: Flow Totalizer
Post by: Controls Guy on October 11, 2017, 04:39:51 PM
Yeah, but smart aliens would have had a password on the WiFi. Probably in characters humans can't even pronounce.
Title: Re: Flow Totalizer
Post by: franji1 on October 11, 2017, 04:43:58 PM
Yeah, but smart aliens would have had a password on the WiFi. Probably in characters humans can't even pronounce.
I think they used EBCDIC, not ASCII.  Those aliens were definitely an IBM shop.
Title: Re: Flow Totalizer
Post by: Controls Guy on October 11, 2017, 04:44:03 PM
Plus, he was the first to figure out recreating dinosaurs might be a bad idea.  Smart guy!
Title: Re: Flow Totalizer
Post by: hex1 on October 11, 2017, 04:58:09 PM
It seems i started a great conversation ..lol
Title: Re: Flow Totalizer
Post by: BobO on October 11, 2017, 05:03:34 PM
Yeah, but smart aliens would have had a password on the WiFi. Probably in characters humans can't even pronounce.

Yeah...well...there were probably a few small plot issues. But admit it, Bill Pullman was an awesome president!
Title: Re: Flow Totalizer
Post by: BobO on October 11, 2017, 05:05:51 PM
It seems i started a great conversation ..lol

Doesn't take much with this bunch of...SQUIRREL!
Title: Re: Flow Totalizer
Post by: hex1 on October 11, 2017, 05:31:53 PM
so I have seen!
Title: Re: Flow Totalizer
Post by: BobO on October 11, 2017, 05:44:47 PM
so I have seen!

Still happy to help you though.
Title: Re: Flow Totalizer
Post by: Controls Guy on October 11, 2017, 06:53:42 PM
I think they used EBCDIC, not ASCII.  Those aliens were definitely an IBM shop.

I think IBM was found to be the Nazgul (at least the lawyers cause they could darken the sky with them).  Do Nazgul count as aliens?

"Not long ago, the Black Gate of Armonk swung open. The lights went out, my skin crawled, and dogs began to howl. I asked my neighbor what it was and he said, 'Those are the nazgul. Once they were human, now they are IBM's lawyers.'" (IBM is headquartered in Armonk, New York).