Command: FormulaCalc
- Updated2023-02-21
- 3 minute(s) read
Command: FormulaCalc
Uses the Calculator AUT 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 You can use the Calculate command to calculate a function in the VBS syntax. Use the Calculate command to include units in quantity-based calculations and to do symbolic replacements. The FormularCalc command ignores the setting of the CalcQuantityBased variable and never calculates quantity-based. |
| Note If you want to use waveform channels in this command, follow rule 2.3 for calculating with waveform channels. |
| Note Use the unique definitions for channels and channel references when you calculate with data channels. |
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 FormulaCalc("Ch('Group2/Result') := 2 * '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 FormulaCalc ("Ch('Group3/Result'):= Exp('Group1/Input')")
Related Topics
Command: Calculate | Command: ChnCalculate | 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

