Product Features
...
DeviceHub
Tags

Tag Formula Variables

2min

When you Add Tags, you have the option of adding a formula to process the generated data.

You can use the following variables:

  • value: The current tag value.
  • timestamp: The time the tag value was generated represented in UNIX time in milliseconds.

You can use the following functions.

Note: For additional functions on tag values such as rounding and data conversions, you can use Analytics or the Flows Manager.

Function

Description

Use

sin

(sine)

The ratio of the side opposite a given angle (in a right-angled triangle) to the hypotenuse.

Analysis and control of periodic processes.

cos

(cosine)

The ratio of the side adjacent to an acute angle (in a right-angled triangle) to the hypotenuse.

Analysis and control of periodic processes.

sqrt

(square root)

The square root of a number is the factor that you can multiply by itself to get that number.

Identify deviations from expected values or detect abnormal conditions.

tan

(tangent)

The ratio of the sine of an angle to the cosine of that angle.

Used in calibration formulas to correct or compensate for non-linearities.

power

A function with a single term that is the product of a real number, a coefficient, and a variable raised to a fixed real number.

power(x) is equivalent to 10^x.

Perform exponentiation when converting values between different units or applying non-linear scaling.

log

(logarithm)

The inverse function to exponentiation.

log(x) is equivalent to the natural logarithm of x (a logarithm with base e).

Perform logarithmic scaling or conversion when there is a non-linear relationship between the register value and the desired output.

exp

(exponential)

Calculates the exponential growth or decay of a given set of data.

exp(x) is equivalent to the exponential function e^x.

Perform exponential scaling or conversion when there is a non-linear relationship between the register value and the desired output.