Skip to main content
Skip table of contents

Formulas


Formulas can be used to perform various arithmetic operations (addition, subtraction, multiplication, division and all operations that can be used with JavaScript).

A Formula calculates a value every 10 seconds, but this value is not stored historically. However, if this is required the Formula must be written to a signal.

  1. Use the Plus sign to create a new Formula. If you want to edit a Formula, click the button (the area around the Plus sign) to get a list of all existing formulas. From there you can select the signal to be processed.

  2. Assign the name of the Formula in the Basic Configuration. The Description field is optional. The "Group" field shows the group in which this formula was created. The path is generated automatically by the system. The "Numeric" value is preset in the "Type" field.

  3. Clicking the "Signal" field opens another window. A previously created signal can be selected there. The value calculated by the formula is written to the signal. The formula is then calculated in the background every 10 seconds and saved as a live value and as a historical value for the signal. The signal can then be used like any other signal in the widgets and with different compressions.

A signal type: "Input" is usually used for this purpose. The signal must not be assigned to a data source. Limitation: Conditions cannot be triggered on the described signal.

4. If the checkmark for "Only with full set of variables" is set, the formula is only calculated if all signals have a value at the time, i.e. if one signal is recorded every 5 minutes and 1 signal is recorded every minute, the formula receives a value only every 5 minutes, since the signals of the formula only have a value in common every 5 minutes. If the checkmark is not set, a 0 is inserted for the missing variables or signals and the formula is calculated, even though some signals are missing.


Numeric Settings

  1. Places after the decimal point indicate the decimal places of the calculated value.

  2. Unit is the unit of the value, (e.g.: V or m³/h).


Variables

In order to use system values such as signals or formulas in the calculations, you must first select them in the "Variables" section.

  1. Assign name.

  2. The ObjectType field determines whether signals or formulas appear in Select Entity.

  3. Selecting the Object field opens the Select Entity window, in which a previously created signal or formula can be selected, depending on the selection in the ObjectType field.

  4. In the "VariableType" field, you can distinguish between the following options:

     

    1. Normal: The compressed value of the signal is applied according to the compression interval

    2. Minimum: The minimum value of the signal is applied according to the compression interval

    3. Maximum: The maximum value of the signal is applied according to the compression interval


Formulas

If you activate "Global", the same formula is applied in each interval.

Here you can find a good overview of the mathematical JavaScript operations that can be included under "Formula": https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math

The checkmark "Calculate in advance" to calculate formulas in advance allows you to calculate in the formula using values from the previous interval. For example, the hourly value for 02:00 hours can be calculated with the hourly value at 01:00 hours. If the checkmark is set, another variable is provided in the Formula Editor:

preValues – is a list which contains all values of the previous interval in the formula.

The sorting of the list matches the sorting of the variables, i.e. the 1st position in the list is the value of the 1st variable and the 2nd position in the list is the value of the 2nd variable, etc.

For example, the variable can be used as follows:

There is a variable A that counts the operating hours.

Now, in the formula, if you request the daily interval, the value for the selected day is subtracted from the value for the previous day. In this way, you can display differences for a signal and calculate using the previous day's values.

If the formula is not global:

The interval types can also be treated individually: the mathematical expression is defined in the Formula Editor or in the Formulas section. The expression is entered in the left text field e.g.: "A + B". In this mathematical expression, the created variables can be used with names. It is possible to create a separate expression for each data interval, i.e. if you request daily values in a graph, you can display a summation of two values. In this way, when requesting hourly values, a division can be represented without having to create two custom formulas.

  1. Specify interval formula.

  2. Select value interval type (see table "Possible interval types").

  3. Select compression type:

    1. Arithmetic mean: sum of all values divided by the number of those values.

    2. Sum: Totals all underlying records.

Possible interval types:

The value interval type specifies the interval on the basis of which the formulas are to be calculated. In this way, in the case of daily values, you can set whether you want the formula to be based on the hourly values.

The value interval type must always be less than or equal to the selected formula interval (maximum daily interval for the daily interval formula, maximum hourly interval for the hourly interval formula, etc.).

The daily value of the formula then results from the 24 hourly values of the signals and the set compression, so the 24 values are then either added up or an average value is generated.

The value interval type Standard stands for the selected formula interval in each case. Thus, process values are then created from the process values of the signal, hourly values from the hourly values of the signals, daily values from the daily values of the signals, and so on.

If Standard is selected, no compression is set.

Interval Type

Description

Standard

No compression.

Process interval

The process interval corresponds to the interval set in the signal.

Minor interval

Equivalent to 15 minutes and is therefore the smallest interval.

Hourly interval

Equivalent to one hour and thus 4 times the minor interval.

Two-hourly interval

Equivalent to two hours and thus twice the hourly interval.

Daily interval

Equivalent to 24 hours and thus 12 times the two-hourly interval.

Weekly interval

Equivalent to 7 days (168 hours) and thus 7 times the daily interval.

Monthly interval

Equivalent to 30 days (720 hours) / 28 days (672 hours) / 29 days (696 hours) / 31 days (744 hours) and thus approximately 4 times the weekly interval.

Quarterly interval

Equivalent to 90 days (2160 hours) / 91 days (2184 hours) / 92 days (2208 hours), and thus approximately 3 times the monthly interval.

Yearly interval

Equivalent to 365 days (8760 hours) / 366 days (8784 hours) and thus 4 times the quarterly interval

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.