DIAdem Help

Executing Calculations Multiple Times

  • Updated2024-09-12
  • 2 minute(s) read

Executing Calculations Multiple Times

Use calculations to create and to execute templates for recurring, user-defined formulas. In these formulas you can execute functions on values, variables, and channels and store the results in channels or in variables.

If you want to execute calculations multiple times, you must use variable inputs and outputs in these calculations. To obtain variable inputs and outputs, you insert the expression @@CCR@@ in the input and output references. Then switch the calculation to the extended mode to specify the number of cycles. DIAdem replaces the expression @@CCR@@ with the current cycle number every time a cycle executes.

To create a calculation that DIAdem successively executes for all existing temperature channels complete the following steps .

Note  For this example, delete all the data in the Data Portal and load the data file Example.tdm from the user folder.
  1. Select DIAdem ANALYSIS.

  2. Click Calculation Manager on the toolbar.

  3. Click New to delete the current calculation set.

  4. Click Add Calculation to create a new calculation.

  5. Enter the name of the calculation in the subdialog box, for example, Multiple.

  6. Click Extended to switch the calculation into the extended mode.

  7. Click Add Input in the Inputs area to create an input for the calculation.

  8. Enter Temp as the Name , select Channel as the Data Type, and enter Temperature_@@CCR@@ as the Reference.

  9. Click Add Input in the Inputs area to create an input for the calculation.

  10. Enter Offset as the Name, select Value as the Data Type, and click the input field in the Reference column to specify the value.

  11. Reference the offset in the subdialog box. To do so, select Expression and enter 5. Select the Unit symbol °C for the unit. Click OK to close the dialog box.

  12. Click Add Output in the Outputs area to create an output for the calculation.

  13. Enter TempErg as the Name , select Channel as the Data Type, and enter TempErg/TempErg_@@CCR@@ as the Reference.

  14. Enter the Calculation script which calculates the offset correction:
    Call Calculate("TempErg = Temp-Offset",CurrSymbols,CurrValues,"")

  15. Enter 3 as the number of Cycles.

  16. Click Validate to check whether DIAdem can execute the calculation.

  17. Click Execute to run the calculation.
    DIAdem repeats the calculation three times. DIAdem creates the channel group TempErg in the Data Portal and saves the results of the individual cycles in the channels TempErg_1, TempErg_2, and TempErg_3.

  18. Click OK to close the dialog boxes.