Command: ValMin
- 已更新2023-02-21
- 閱讀時間為 2 分鐘
Command: ValMin
Determines the smaller of two numbers.
Input Parameters
Value |
Specifies the first numeric value. |
Value |
Specifies the second numeric value. |
Return Parameters
| ReturnValue | The return value is a Floating-point number type. |
Example
The following example determines the lower of the two variables MyValue1 and MyValue2.
| VBScript | Python |
Dim MyValue1, MyValue2, intMyResult MyValue1 = Pi MyValue2 = e intMyResult = ValMin(MyValue1,MyValue2) 'intMyResult = 2.71828182845905
The following example determines the lower value in each line of the Group1/Input and Group1/Reference data channels and saves the results in the Group2/Result data channel.
| VBScript | Python |
Call Calculate ("Ch(""Group2/Result"")= ValMin (Ch(""Group1/Input""),Ch(""Group1/Reference""))")
| Note You must use the Calculate command in scripts to calculate data channels with formulas. Compute the data channels according to the syntax in the Calculator. Refer to the procedures Executing Channel Calculations in the Calculator and Assigning a Value to a Variable in the Calculator for more information about the Calculator. Use the MinV command instead of ValMin when you calculate quantity-based. |
Related Topics
Command: ValEqual | Command: ValEqualGT | Command: ValEqualLT | Command: ValGT | Command: ValLT | Command: ValMax | Function: MaxV | Function: MinV

