DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Command: ValMax

Display all  Hide all

Command: ValMax

Determines the greater of two numbers.

ReturnValue = ValMax(Value, Value)

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.

Examples

The following example determines the greater of the two variables MyValue1 and MyValue2.

VBScriptPython

 

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.

VBScriptPython

 

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.

Related Topics

Command: ValEqual | Command: ValEqualGT | Command: ValEqualLT | Command: ValGT | Command: ValLT | Command: ValMin | Function: MaxV | Function: MinV

Was this information helpful?