in
Creating Smarter Networks

Mathfunctions on a Logger

Last post 02-01-2010 12:38 AM by troggendorf. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-28-2010 5:46 AM

    • Ralf
    • Top 75 Contributor
    • Joined on 01-28-2010
    • Posts 2
    • Points 40

    Mathfunctions on a Logger

     Hi Guys,

    i've got a problem (missing idea) with the values in a logfile.

    I've got 2 meters wich are polled every 15 minutes. They have to send their actual meter-value (kWh) which ist written in the logfile.

    Now i need to visualize not the meter-value (wich can be at 13:00 = 1200 kWh / 13:15 1250 kWh) but the difference between these two values.

    In this case it is 50kWh.

    Ich need to visualize these values historical back for one month. 

    Has anyone an idea how to solve this?

    • Post Points: 20
  • 01-28-2010 9:11 AM In reply to

    Re: Mathfunctions on a Logger

     Hi Ralf

    When the data is already logged, you can only extract it an manipulate it by an external script on your PC (if the log is CSV you can probably use a spreadsheet applycation to import the data and get the differences relatively easyly). If you want to set up the log you can use a Typetranslator block to turn the sign of one value and an analog function block to sum the two. If you want the absolute difference you can use another (or even the same) type translator block to abs the value. If you log the result you have the (abs) difference right in the log. You can log the raw values and the difference in the same log if you need.

          Regards

          Thorsten

    • Post Points: 20
  • 01-28-2010 1:54 PM In reply to

    • rmhair
    • Top 10 Contributor
    • Joined on 12-14-2007
    • San Jose CA
    • Posts 17
    • Points 240

    Re: Mathfunctions on a Logger

     Ralf,

     Probably obvious, but one should be careful of their collection timing.  Two data points fed into an analog function block a second apart will result in two outputs from the block.

    Just log the analog function block output a minute or so after polling the inputs to the block...

    Richard Hair
    Kenmark Controls
    www.kenmarkcontrols.com
    LonMark Certified System Integrator
    • Post Points: 20
  • 01-29-2010 1:15 AM In reply to

    • Ralf
    • Top 75 Contributor
    • Joined on 01-28-2010
    • Posts 2
    • Points 40

    Re: Mathfunctions on a Logger

     Oh sorry.There is a mistake in the discription of my problem.

    The soloutions written describes how to subtract meter2 - meter1 = difference between these two values.

    That is a misunderstanding.

     

    I need the difference between two values from one and the same meter. Like this:

    Meter 1 @ 13:00 = 1200kWh --->into logfile1

    Meter 1 @ 13:15 = 1250kWh --->into logfile1

    -------------------------------------------

    difference @ 13:50 = 50kWh ----> into logfile2

     

    And this procedure for 2 Meters.

    I have to visualize it with a Logfile-Graph in Ilon-Vision. Maybe the one an only solution is to have an script (maybe java) which calculates the difference.

     

    • Post Points: 20
  • 02-01-2010 12:38 AM In reply to

    Re: Mathfunctions on a Logger

     Hi Ralf

     Use a type translator with two inputs NVs: your meter point and the current time frrom the real time clock of the SmartServer. Have four output NVs tmp1, tmp2, out1, out2. Write a type translator rule like this:

    if time.minute == 00

         copy tmp * -1 to out2

         copy meter to out1

         copy meter to tmp

    Do this every quater hour (i.e. copy that instruction and change the IF statement to if time.minute == 15 and so on). You may have to write the rule to alternate between two tmp NVs, you'll have to play around with it a bit. Use the analog function block to sum out1 and out2.

    Hope that works

        Thorsten

    • Post Points: 5
Page 1 of 1 (5 items)
©2008 Echelon Corporation