Announcement

Collapse
No announcement yet.

Accumulation counter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • Accumulation counter

    Hello! My task is as follows. I need to accumulate flow from a flowmeter with a 4-20 mA signal.
    I scale the 4-20 mA signal to 0-50000 liters. I successfully get instant consumption. Can I accumulate data in the PLC Click program? I need to add every instant value to the previous one, every second. At the border of the hour, I need to divide the amount by 3200 seconds to get the average consumption per hour. Next, I need to add the average consumption during the day every hour. At the border of the day, divide the amount by 24.
    I can not summarize the values ​​obtained in DF1.
    Is it possible to implement this?
    Thanks for the help.


  • #2
    youll have to copy into multiple df registers then use the math function a few times. To sequentially load multiple df registers is likely going to require the use of counter[s] and/or indirect addressing to copy to the correct df locations (see Pointer addressing in the help file.)

    does your click have a real time clock? if so you can use SD26 _RTC_SECOND as the source for your indirect addressing, so itll count from 0 to 59 and begin again. oneshot math when it gets to 59, then using SD25_RTC_MINUTE copy to minutes section, when minutes section gets to 59, math again, then using SD23 _RTC_HOUR copy to hour section.

    YOULL NEED TO COPY FROM THE SD TO A DS DATATYPE TO USE AS A POINTER, DO SO AT THE BEGINNING OF YOUR LOGIC (ie DS1 = ptrSeconds, DS2 = ptrMinutes, DS3 = ptrHour )

    i need java....bad....
    Last edited by quaizywabbit; 10-09-2019, 10:17 AM.

    Comment



    • #3
      accumulate using RTC (2).zip edited but nothing to test on here..more or less complete to accumulate the sums...tweak to taste to extract data you want
      Last edited by quaizywabbit; 10-09-2019, 12:37 PM. Reason: edit the file

      Comment

      Working...
      X