Creating a Calculation Script with Debug Option
- Updated2024-09-12
- 2 minute(s) read
Mathematics > Creating a Calculation Script with Debug Option
Creating a Calculation Script with Debug Option
Use calculations to create and to execute templates for recurring, user-defined formulas.
In these formulas you connect inputs that reference values, variables, or channels and store the results in outputs that reference variables or channels. You only can define single-line formulas. To define a multi-line specification, switch to the Extended mode and enter the calculation script instead of a formula. The easiest way to create and to test a calculation script is in the script editor in DIAdem SCRIPT.
To create a calculation that contains a multi-line calculation script 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. |
Select DIAdem ANALYSIS.
-
Click Calculation Manager on the toolbar.
-
Click New to delete the current calculation set.
-
Click Add Calculation to create a new calculation.
-
Enter the name of the calculation, for example, Distance relative, in the subdialog box.
-
Click Add Input in the Inputs area to create an input for the calculation.
-
Enter t as the Name , select Channel as the Data Type, and select the channel [1]/Time as the Reference.
-
Click Add Input in the Inputs area to create an input for the calculation.
-
Enter t as the Name , select Channel as the Data Type, and select the channel [1]/Speed as the Reference.
-
Click Add Output in the Outputs area to create an output for the calculation.
-
Enter Srel as the Name , select Channel as the Data Type, and enter the channel [1]/Distance relative as the Reference.
-
Click Extended to switch the calculation into the extended mode.
-
Click Execute so that DIAdem creates the inputs and the outputs.
-
Click Copy script to the clipboard to edit the calculation script.
-
Click OK to close the dialog boxes.
Select DIAdem SCRIPT.
-
Click New File on the toolbar.
-
Add the contents of the clipboard to the script editor.
-
Enter the Calculation script which calculates the integral of the speed between Calculation Script Begin and Calculation Script End:
VBScript Python Call ChnIntegrate(t, V, Srel) Call ChnUnitConvert(Srel, Srel, "mm") -
Click Run Script or Debug Script on the toolbar to test the script or to debug the script.
-
Select the rows between Calculation Script Begin and Calculation Script End and paste these rows with <Ctrl C> to the clipboard:
Select DIAdem ANALYSIS.
-
Click Calculation Manager on the toolbar.
-
Click Edit Calculation.
-
Click Extended to switch the calculation into the extended mode.
-
Insert the contents of the clipboard with <Ctrl V> into the Calculation Script.
-
Click Execute to start the calculation.
-
Click OK to close the dialog boxes.
