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?

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.

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?

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.

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

Hi,<br><br>That is exactly what I neeeded! Thank you Ursula and greetings from Poland :)