Command: ChnCalculate
- Updated2023-02-21
- 2 minute(s) read
Command: ChnCalculate
Uses the Calculator VBS syntax to calculate a formula in a script.
Input Parameters
FormulaTxt |
Specifies a formula in a script. Enter the formula in quotation marks. You must enclose texts that are in quotation marks, such as channel names, in double quotation marks. |
| Note Use the Calculate command to include units in quantity-based calculations and to replace symbols with values in formulas. |
Examples (Script)
The following example doubles each value of the Group1/Input data channel and saves the result in the Group2/Result data channel.
| VBScript | Python |
Call ChnCalculate("Ch(""Group2/Result"")= 2 * Ch(""Group1/Input"")")
The following example exponentiates the values of the Group1/Input data channel to the base e (Eulerian number) and saves the result in the Group3/Result data channel.
| VBScript | Python |
Call ChnCalculate("Ch(""Group3/Result"")= Exp(Ch(""Group1/Input""))")
Related Topics
Command: Calculate | Command: FormulaCalc | Connecting Channels and Values in Calculations | Creating a Calculation Script with Debug Option | Creating and Executing Calculations | Executing Calculations Multiple Times | Executing Channel Calculations in the Calculator | Repeating Calculations Automatically | Running Comparisons on the Calculator | Using Channel Lists in Calculations | Variable: CalcQuantityBased | Working with Dependent Inputs | Working with Text in the Calculator

