Classification
OTL Syntax
/// Local Declarations
Quantities.Quantity QuantityVariable;
/// Flow
QuantityVariable = Quantities.CreateQuantity(NumericTerm, UnitTerm, NumericTerm);
Description
The CreateQuantity term is the constructor for a Quantity. It provides a reference to a definition of the unit that is associated with the Quantity. The reference of the unit refers to the SHORT-NAME of an unit UNIT-SPEC document definition within an ODX.
Return Value
The Term returns the value, see table below.
|
|
In OTX, Terms are categorized according to its return data type!
|
Data Type |
Description
|
Quantity |
Created Quantity.
|
Properties
Name |
Data Type |
Class |
Default |
Cardinality |
Description
|
Numeral |
Numeric |
Term |
- |
[1] |
Represents the numeric value from which the Quantity shall be created (in display units). The value can be either an Integer, a Float or another Quantity.
|
DisplayUnit |
Unit |
Term |
- |
[1] |
Represents the display unit of the to-be-created Quantity.
|
DisplayPrecision |
Numeric |
Term |
- |
[0..1] |
Optionally represents the display precision of the to-be-created Quantity. Float values shall be truncated.
|
OTL Examples
/// Local Declarations
Quantities.Quantity Quantity;
/// Flow
Quantity = Quantities.CreateQuantity(12.44, [@Unit, "BL_DataLibraMIB.odx", "km/h"], 0);
See also
GetDisplayValue
GetDisplayUnit
GetBaseUnit