Data processing makes it possible to process captured information on the server side with formulas or other information.
To process data further, data streams can be edited on the Asset Details page.
After that, you can navigate to the "Data Processing" tab.
Formula syntax
The syntax is based on the PHP programming language and allows the user to execute various formulas in a secure environment. Only a few guidelines have to be followed:
- The calculated value must be returned via the return statement.
- Each line/statement must be terminated with a semicolon ( ; ).
- Other values of the same object can be added via the right bar by clicking on the value.
- All available functions can be viewed via the right bar by clicking on the "Functions" tab.
- Variables can be defined with a $ sign
Examples
The following example always returns the value 12:
The following example assigns the value of the data stream Current to the variable $strom and multiplies it by 4 before returning it:
The following example calculates the difference between 2 data points and returns the result:
Common formula notations are also possible. The . is used as the comma character.
This function rounds the $percentage variable to the nearest value.
Preview
For formulas, the preview can also be activated before saving. This shows the expected result of the formula.
If information is missing or a formula is to be tested with special values of data, the values can be changed independently.