Command: ValMax
- Updated2024-09-12
- 2 minute(s) read
Command: ValMax
Command: ValMax
Determines the greater of two numbers.
Input Parameters
![]() |
Specifies the first numeric value. |
![]() |
Specifies the second numeric value. |
Return Parameters
ReturnValue | The return value is a Floating-point number type. |
Examples
The following example determines the greater of the two variables MyValue1 and MyValue2.
VBScript | Python |
Dim MyValue1, MyValue2, intMyResult MyValue1 = Pi MyValue2 = e intMyResult = ValMax(MyValue1,MyValue2) 'intMyResult = 3.14159265358979
The following example determines the greater 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"")= ValMax (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 MaxV command instead of ValMax when you calculate quantity-based. |