A secondary feature of the processing node is the ability to perform calculations and statistics on the monitored variables.
These additional calculations and statistics are logged like variables ( see article STM32CubeMonitor:How to record and replay data) and are added as outputs of the processing node to be rendered graphically like the other variables.
- Operations on variables can be mathematical ( +, -, /, %, mod,....) , trigonometry ( sin(), cos(), tan()... ) or logical ( and, or , not ...).
- Statistics on variables are minimum , maximum, average and standard deviation. The scope of these statistics can be the entire acquisition or the last N points of the acquisition ( N defined by the user ).
After opening the processing node, post processing functions can be accessed by opening the "Post-processing" section. 2 sheets are available :
- Expression sheet will allow to build expression mixing available variables, operations and statistics.
- Statistic sheet will allow to build statistics on variables available , for entire acquisition or last N points.
1. Example of Expression
Here are the steps to perform the sum of 2 variables.
1 - Fill the field Expression name, in this example "SumOfVar1Var2".
2 - Write your formula directly in the field Formula or by using operations pick-list and double-clicking on variables available.
3 - Clicking on the button +add to control the expression coherency and add it to the outputs list.
4 - Deploying the flow to save the new configuration. When starting an acquisition, the new expression is calculated and is visible like the other variables.
2. Example of Statistic
Here are the steps to perform the average of 10 last read values of Variable1.
1 - Fill the field Statistic name, in this example "AverageVar1".
2 - Select the Variable, in this example "Variable1".
3 - Select the Function, in this example "Average".
4 - Select the Scope. in this example, average of the 10 last values read.
5 - Click on the button +add statistic to add the statistic to outputs.
6 - Deploying the flow to save the new configuration. When starting an acquisition, the new statistic is calculated and is visible like the other variables.