How to perform additional calculations on measurements

Revision as of 16:30, 12 February 2020 by Registered User

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.
post processing Main.png
  • Statistic sheet will allow to build statistics on variables available , for entire acquisition or last N points.
postprocessing statistic.png

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".

postprocessing expression name.png


2 - Write your formula directly in the field Formula or by using operations pick-list and double-clicking on variables available.

postprocessing writeformula.png


3 - Clicking on the button +add to control the expression coherency and add it to the outputs list.

postprocessing addexpression.png


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.

postprocessing sumfo in graph.png

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".

postprocessing namestat.png


2 - Select the Variable, in this example "Variable1".

postprocessing statistic selectvar.png


3 - Select the Function, in this example "Average".

postprocessing statistic selectfunction.png


4 - Select the Scope. in this example, average of the 10 last values read.

postprocessing statistic selectscope.png


5 - Click on the button +add statistic to add the statistic to outputs.

postprocessing statistic validation.png


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.

postprocessing statistic graph.png