Showing results 1 to 5 of 5

Thread: Subtraction of current variable value and value of the same variable from one hour ago.

  1. #1
    Join Date
    01.07.2019
    Posts
    4

    Default Subtraction of current variable value and value of the same variable from one hour ago.

    Hi,

    I would like to display in Numeric Value the subtraction of current variable value and the value of the same variable from one hour ago. The result will change every 10 minutes. The variable is archived in 1 second cycle time.

    How to implement such functionality?
    Last edited by grzegorz_kaczmarczyk : 20th August 2019 at 09:01

  2. #
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    809
    Best Answer

    Default Re: Subtraction of current variable value and value of the same variable from one hour ago.

    Maybe try to use zenon function 'Report Generator: execute'. You can call it from 'Time Control' module.

  3. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    809

    Default Re: Subtraction of current variable value and value of the same variable from one hour ago.

    You can make the variable 'externally visible' for zenon Logic. In Logic then remember the values, e.g. in an array size 6 (60 minutes/10 minutes) configured to be 'retain' (will "survive" the project restart). Also in Logic calculate the difference and in zenon display in numerical element the stratonNG variable with the result.

    It is possible to access the past values stored Historian by API (VBA, Add-In), but it would significantly more complicated.

  4. #3
    Join Date
    01.07.2019
    Posts
    4

    Default Re: Subtraction of current variable value and value of the same variable from one hour ago.

    Hi,

    Thank you for your advice. It's sure one of the options, that can be helpful.

    Meanwhile, I have created a report generator in which I store 600 last values of the variable (cycle time x 10 minutes). Thus, this gives us possibility to calculate the desired value by subtracting results from cells. So, I could possibly use variablerw function to transfer that value to the variable, but it seems that the report generator does not refreshes by itself.

    How to make report generator to refresh every 10 minutes, so the value could be calculated?
    Last edited by grzegorz_kaczmarczyk : 20th August 2019 at 12:43

  5. #4
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    809
    Best Answer

    Default Re: Subtraction of current variable value and value of the same variable from one hour ago.

    Maybe try to use zenon function 'Report Generator: execute'. You can call it from 'Time Control' module.

  6. #5
    Join Date
    01.07.2019
    Posts
    4

    Default Re: Subtraction of current variable value and value of the same variable from one hour ago.

    Hi,

    That is exactly what I neeeded! Thank you Ursula and greetings from Poland

Similar Threads

  1. Replies: 2
    Last Post: 10th March 2017, 04:47
  2. 1. Modify BitAddr of variable, 2. edit SubItems of variable
    By professor_hubert_farnsworth in forum VSTA
    Replies: 3
    Last Post: 18th January 2017, 09:46
  3. How to display CEL/AML time column in 24 hour format
    By jjplaw in forum zenon Supervisor
    Replies: 2
    Last Post: 24th February 2013, 07:41
  4. Replies: 1
    Last Post: 2nd August 2011, 10:21
  5. Replies: 1
    Last Post: 23rd July 2011, 08:51

Posting Rules

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