Portal manual
  • Sensori portal manuals - landing page
  • General
  • Workspaces
  • Organisations
  • Users
  • Tags
  • Devices
  • Rules
  • Sources
  • Events
  • Locations
  • Maps
  • Aggregates
    • VMI delta calculations
  • Exports
  • Formulas
  • How to ...
  • Device configurations
  • Supported browsers
  • Notification channels
Powered by GitBook
On this page
  • General
  • Creation
  • Example
  • Placeholders
  • Available functions

Formulas

Run mathematical formulas on every measurement of a tag

PreviousExportsNextHow to ...

Last updated 4 years ago

General

Formulas can get applied to all incoming measurments of a tag. Multiple following formulas can be added to a single tag which will get executed in the order specified.

Creation

If you go to the details of a tag, a formula can be created.

The expression is where the user can add a mathematically sound formula. For example; (20-(measurement*0.00001957))/(20-4))*100 As can be seen in this example the text measurement is a placeholder, where the measurement value will be placed at the moment of execution of the formula.

The order of execution of formulas for the tag is dictated by the Formula Order field. So if you have multiple formulas to execute, be sure they are in the right order with the Order field.

Example

Assume the following points;

  • Tag is getting a measurement of 10

  • Tag has 2 formulas

    • Tag has formula with order of 1 that has this expression: measurement*2

    • Tag has formula with order of 2 that has this expression: measurement+5

At execution time the following will happen;

  1. measurement starts with raw value from device at value 10

  2. apply formula 1, measurement is 10*2 = 20

  3. apply formula 2, measurement is 20+5 =

  4. tag measurement result value is 25

Placeholders

To add placeholders you can just type the name of the place holder, lets say temp01 in the formula. After typing it in the formula, also be sure to add the text into the placeholders group by typing it, in this case temp01 in the placeholders fields and hitting enter. The platform will resolve this value accordingly at the moment of execution of the formula.

If a formula contains placeholders. The platform will try to resolve them to values. If that fails, the formula will abort execution. So if your formula has placeholders and its not working, it's probably failing placeholders.

Available functions

Listed below you can find the available functions, used for example like this 2*exp(5) or 2*m+exp(a) Or a more comlex example to go from windspeed m/s to beaufort; ceil(((m/0.836)^2)^(1/3))

// Trigonometric functions 'sin' 'cos' 'tan' 'cot' // Trigonometric functions, argument in degrees 'sind' 'cosd' 'tand' 'cotd' // Inverse trigonometric functions 'arcsin' 'arccos' 'arctan' 'arccot' // Exponentials and logarithms 'exp' 'log' 'ln' 'lg' // Powers 'sqrt' // Hyperbolic functions ' sinh' 'cosh' 'tanh' 'coth' // Inverse hyperbolic functions 'arsinh' 'arcosh' 'artanh' 'arcoth' 'abs' 'sgn' // Rounding functions 'round' 'floor' 'ceil'

Coming soon more on: organisation shared formula templates via library.

Currently placeholders are optional in the formula and only supported for use in aggregates. See page for more details.

this