Showing results 1 to 3 of 3

Thread: Is it possible to create one variable from archive?

  1. #1
    Join Date
    17.01.2018
    Posts
    5

    Default Is it possible to create one variable from archive?

    Hello everyone!
    Today I am developing a new functionality to existing project in zenon. I would like to store one archive value, from few days before today to new variable in zenon. The reason to do that is that I I have a project with about 50 water meters and I want to check if there were no consumption in few days (for eg. 3,4 or 7 days) which could indicates problems with meter (cause there is always some water consumption). Each meter actual reading is stored to archive every 24 hours.  In SQL I will do that for example in that way:
      
    SELECT Value from Table WHERE Date = dateadd(day,datediff(day,3,GETDATE()),0) 

    To explain problem more carrefully I will show an example:

    Day of week - Meter Reading [m3]
    Monday          - 150
    Tuesday         - 150
    Wednesday     -150
    Thursday        - 150 [Check if Thursday(actual) value is = Monday value, if it is true show an error] - error
    Friday            -150 [Check if Friday(actual) value is = Tuesday value, if it is true show an error] - error   
    Saturday        -165  [Check if Saturday(actual) value is = Wednesday value, if it is true show an error] - no error  
    Sunday          - 165  [Check if Sunday(actual) value is = Thursday value, if it is true show an error] - no error
    etc.

    Is it possible in zenon or maybe I need to prepare VBA macro for that? Or maybe there is another solution for this?

    Best regards!
    michalt



  2. #2
    Join Date
    28.02.2013
    Posts
    118

    Default Re: Is it possible to create one variable from archive?

    Good Morning Michalt,

    you could use allocations to store the old value and use a mathematics variable to compare the actual value to the old value.
    The allocation could be updated automatically using a zenon time function.

    If more sophisticated logics are needed, you can use zenon Logic, our integrated IEC 61131-3 compliant Soft-PLC, for storing, comparing and various reactions on the results.

    Best regards,
    Felix

  3. #3
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    765

    Default Re: Is it possible to create one variable from archive?

    The values already stored in archives are accessible via API, but it would be complex code to find the right one for the compare. Like Felix noticed - the easier ways are without the use of Historian. To Felix's proposals, I would add one more:
    If your use-case would be to produce an alarm after only one period, you would not need additional variables or Allocations; only a reaction matrix with delay.   
    If your use-case is to produce alarms not after only one period, but with 3 alarm classes: "Info" after 3 days, "Warning" after 5 days and "Error" after 7, then I propose to use limits with delay on the water consumption variables and also on additional Internal variables.
    1. For each variable representing a water consumption create 2 additional Internal variables.
    2. Create Allocations: to copy water consumptions to these internal variables.
    3. Each water consumption variable link with multi-numerical reaction matrix evaluating any value change, with active 'treat each change of value as new limit' and delay = 3 days = 259 200 s (3x24x60x60).
    4. The internal variables link with remas causing alarm after delay for 5 and 7 days.

    As each value change resets the delay - the alarms will appear only when value stays unchanged for long enough.



Similar Threads

  1. Zenon archive issue (archive inactive)
    By eugenius in forum zenon Supervisor
    Replies: 9
    Last Post: 24th August 2012, 08:19
  2. .arx archive edit
    By bastien in forum zenon Supervisor
    Replies: 1
    Last Post: 13th June 2012, 15:06
  3. Replies: 4
    Last Post: 26th May 2011, 00:48
  4. Replies: 0
    Last Post: 12th May 2010, 10:07
  5. How to create a "Time Counter" variable?
    By lephis in forum zenon Supervisor
    Replies: 1
    Last Post: 24th August 2009, 11:17

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •