Isomorphic (Customer) asked a question.

GPM counter?

I'm trying to figure out how to take a GPM value from a prosense flow meter and have the plc count the actual gallons into a total gallons counter that I can reset from an HMI.

 

I have the GPM value coming through correctly and displaying on a c more HMI but I can't get my head around how to properly " count " the actual gallons.

 

Any help is greatly appreciated, i'm new to all of this and I appreciate any help anyone can provide.


  • z28z34man (Customer)

    What PLC platform are you trying to use?

     

    How I do it is with a timer, counter, and a math block. The timer is set to pules at a predetermined rate the counter counts the pulses and the math block scales the current flow to units per pules time period and ads that to the to a running total every time the timer pulses.

  • Isomorphic (Customer)

    productivity p2-550

     

    do you happen to have an example I could work off of?

     

  • z28z34man (Customer)

    ro water total

     

     

    this was a P1-540 and i was incorrect there is not counter. I mixed up running averages and totals in my head

     

    i have 100 ms flasher which is 100 ms on 100 ms off 200 ms for a complete cycle

    the flasher triggers a math block on a positive transition. the math block takes the current flow rate that is in GPM and divides it by 300 (5 pulses per second 60 seconds per min = 1 pulse would be 1/300th of a minute) and adds it to the total.

     

    the reason for the rest of the logic is if the floating point number got too big the small amount added each pulse might not of changed the number

    Expand Post
  • Isomorphic (Customer)

    waterflowrungHere is what i'm currently seeing from my sensor, I have it showing GPM.

     

    I'm confused how I would get it into the format you are showing.

     

    I apologize for my lack of knowledge here. I do greatly appreciate your time

    Expand Post
  • z28z34man (Customer)

    i added some documentation to explain what i am doing and why i am doing it this way

     

    water total

  • ADC TechnologyGroup_01 (AutomationDirect)

    Instead of clearing "Water_Used" in that conditional, you can avoid the accumulation error by a slight logic change, "(Math) Water_Used = Water_Used - 100" which will leave behind the fractional accumulations until the next calculation.

     

    Those are very good comments. You need to be aware of DataTypes and their ranges when creating an accumulator. Resolution, Accuracy, and Maximum values must all be considered.

    Expand Post
    • Isomorphic (Customer)

      I apologize for my lack of knowledge here....

       

      i'm not sure I follow your suggestion. If I used the "(Math) Water_Used = Water_Used - 100"  where would that get placed and what would then need to be removed?

      • z28z34man (Customer)

        instead of the copy data that zeroes out Water_Used there should be an other math block that subtracts 100 from Water_Used.

         

        That way we do not loose the small fraction that is over 100 gallons when it adds to the holding register.

  • Isomorphic (Customer)

    gpmtotalworkingTHANK YOU! Works great.

     

    one last question if I wanted to have a Reset line what would be the proper way to zero out the total count?

     

     

    Expand Post
    • z28z34man (Customer)

      add a line below that has your zero as a normally open contact that activates a copy data the copies a 0 to both the holding register and the Water_Used

10 of 11