Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

In the statement, other historical values and constants may appear, but not other types of D2000 objects (e.g. I/O tags). If we want to use the values of another type of object, we must first configure the primary historical value for it.


Info

In fact, such a definition of the calculated historical value will cause the D2000 Archiv process, which is the parent of the historical values, to create for each row of the archived structure (according to the Archive Size parameter) one "shadow" historical value and generate the corresponding calculation for it:

  • 1. row: (H.MyPlc_T1[1] + H.MyPlc_T2[1] + H.MyPlc_T3[1]) / 3
  • 2. row: (H.MyPlc_T1[2] + H.MyPlc_T2[2] + H.MyPlc_T3[2]) / 3
  • 3. row: (H.MyPlc_T1[3] + H.MyPlc_T2[3] + H.MyPlc_T3[3]) / 3
  • ... etc.

The advantage of structured calculated historical values is that we define the calculation for the entire column of the structure in a simple way. In addition, if we add more rows to the structure, new "shadow" historical values will automatically be created for the new rows, so we don't have to modify the historical value at all. And if we need to change some archiving parameter (e.g. history depth) or change some calculation parameter (e.g. add a new temperature T4), it is convenient to do it in one place.

...

Info
titleAdvanced tips

As with the eval tags, it is possible to replace invalid values with zero, use the %IsNull function, and use various mathematical functions and expressions, including a conditional expression.

The so-called extended syntax is also supported, which allows dividing the calculation into several steps, defining local variables, using the condition IF - THEN - ELSE and jumping to the label - GOTO.

In addition, special functions for calculated historical values are available. It is also possible to use the @EvalTime system constant in the calculation, which represents the time for which the calculation is performed.

Podobne ako v prípade počítaného bodu je možné nahradiť neplatné hodnoty nulou, použiť funkciu %IsNull a použiť rôzne matematické funkcie a výrazy, včítane podmieneného výrazu.

Podporená je aj takzvaná rozšírená syntax, ktorá umožňuje definovanie lokálnych premenných, použitie IF - THEN - ELSE a GOTO.

Navyše sú dostupné špeciálne funkcie pre vypočítané archivované hodnoty. Je taktiež možné vo výpočte použiť systémovú konštantu @EvalTime, ktorá reprezentuje čas výpočtu.



Statistical structured historical value

...