Formulas
Run mathematical formulas on every measurement of a tag
Last updated
Run mathematical formulas on every measurement of a tag
Last updated
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.
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.
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;
measurement starts with raw value from device at value 10
apply formula 1, measurement is 10*2 = 20
apply formula 2, measurement is 20+5 =
tag measurement result value is 25
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.
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.