Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

how do I save real values every houre

espenbo
2016-11-26
2016-11-30
  • espenbo - 2016-11-26

    Hi
    I try and save real assets from an energy meter.
    But I'm not sure how I can do it.

    I've used oscat_basic.lib and METER, METER_STAT to see my meter values. But how can I save real values every hour.

    I want to log kW top average value for every houre.

    Duration in minutes: M1, M2, M3, M4 ... M60
    kW value: kW1, kW2, KW3, kW4 ... kW60
    Average hourly kW value: H1, H2, H3, H4 ... H24

    Then I want to save the 3 highest values for the months.
    3 highest values in months: Mont_1_1, Mont_1_2, Mont_1_3, Mont_2_1, Mont_2_2, Mont_3_3 ... Mont_12_1, Mont_12_2, Mont_12_3

    When a new year starts the values for the months will be overwrithen.

    I need some help to start on how to do this. An example on how to store a value in specified intervals would be grate, what function blocks should I use? Please try to explain inn FBD or CFC.

    Thanks for all the help

    Espen (newbie)

    Effektvokter.zip [617.58 KiB]

     
  • Anonymous - 2016-11-26

    Originally created by: AntonZ

    Since you are already using Oscat basic, I suggest you look into the Oscat Network lib for this. It has the DATA_LOGGER component to store data. You can store in a CSV file on the PLC itself with the DLOG_STORE_FILE_CSV component. Or HTML, XML. Store on an SD card if your PLC has this. Use DLOG_FILE_TO_SMTP or DLOG_FILE_TO_FTP to have your PLC send the file to an email address or upload to an FTP server.

     
  • shooter - 2016-11-26

    what PLC are you using, and where do you like to save the data.
    and indeed have a look in oscat network.

     
  • espenbo - 2016-11-27

    Hi
    Thanks for your replay.

    I now have a WAGO 750-849. Otherwise, I tend to use WAGO 750-831.
    So it should work on both PLCs.

    I read the documentation codesys_network_121_hf1
    and thought DLOG_REAL can be used.
    But when I enter lib file and compiles then I get an error message.
    <maximum of="" is="" number="" pous="" compile="" (1023)="" aborted="" exceeded=""></maximum>

    I changed the settings in <of target=""> maximum number of Pous 2023>
    When I get errors
    BASE64_DECODE_STR
    BASE64_DECODE_STREAM
    DLOG_DT
    DLOG_FILE_TO_SMTP
    ...
    XML_READER</of>

    I tried and create a new small program. With only a few blocks.
    I increased max POUs and it gets compiled but with error on memory.
    When I chose 'exclude unused' and got compiled and downloaded.

    But how do I get used values from DLOG on.
    Is there a better approach?

    Espen (Newbie)

    (Does this also as sign so I know what I've done and how I got it fixed.)

    DLOGTEST.pro [361.03 KiB]

     
  • espenbo - 2016-11-30

    Hello.
    I think I found an easier way and bring out the effects of each hour. And take care of the highest impact measured.
    But I have not found any good solution and take care of the daily value so I can find the 3 highest values ​​in months. Or how to save the months view.
    I thought ARRAY can be used. Also had been fine and could list the date, time measurements were from.

    Do you have any good ideas? I have tested some, and tryied to find som more information.

    Here is a link to the program.
    https://www.dropbox.com/.../8cdsdg07... ... ter3.pro...

    Espen

     

Log in to post a comment.