Function: VU
- Updated2023-02-21
- 2 minute(s) read
Function: VU
Connects a value and a unit.
ReturnValue = VU(Value, [Unit])
Input Parameters
| Specifies a numeric value or a variable. | |
| [Unit] | Specifies a unit. If you do not specify the unit, DIAdem uses the unit "1". |
Return Parameters
DIAdem saves the result unit in a quantity-based calculation of the Calculate command in the CalculateResultUnit variable. Refer to the Calculate command for rules for input units and result units.
Examples
The following example calculates the quotient from "10 m/s" and "2 ms" and displays the result value and the result unit as a message.
| VBScript | Python |
CalcQuantityBased = TRUE Call Calculate("R1=VU(10, ""m/s"") / VU(2, ""ms"")") Call MsgBoxDisp("Result: Value " & R1 & " with unit " & CalculateResultUnit)
| 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. |
Related Functions
Function: ^ | Function: Abs | Function: Ceil | Function: Deg | Function: Eex | Function: Exp | Function: Fak | Function: Floor | Function: Frac | Function: Lg | Function: Ln | Function: MaxV | Function: MinV | Function: Mod | Function: Rad | Function: Random | Function: Rnd | Function: Round | Function: RTP (Real To Part of Date) | Function: RTT (Real to Text) | Function: Sign | Function: SND | Function: Sqr | Function: Sqrt | Function: Trunc