Difference between revisions of "Extensions.Quantities.GetBaseUnit"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | /// Local Declarations | |
+ | Quantities.Unit UnitVariable; | ||
+ | /// Flow | ||
+ | UnitVariable = Quantities.GetBaseUnit(QuantityTerm); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 21: | Line 24: | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
Quantities.Quantity Quantity = 12.44 [@Unit, "BL_DataLibraMIB.odx", "km/h"]; | Quantities.Quantity Quantity = 12.44 [@Unit, "BL_DataLibraMIB.odx", "km/h"]; | ||
Quantities.Unit Unit1; | Quantities.Unit Unit1; |
Revision as of 08:04, 25 October 2018
Contents
Classification
Name | GetBaseUnit |
Short Description | Return the base unit of a Quantity value |
Class | Term |
Extension | OTX Quantities extension |
Group | Quantity and Unit related terms |
Exceptions | UnknownUnitException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
/// Local Declarations
Quantities.Unit UnitVariable;
/// Flow
UnitVariable = Quantities.GetBaseUnit(QuantityTerm);
Description
The GetBaseUnit term shall return the base unit of a Quantity value, according to its physical dimension (e.g. "m", "m/s", "s" etc.).
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Unit | The base unit of a Quantity value |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Quantity | Quantity | Term | - | [1] | Represents the Quantity from which the base unit shall be extracted. |
OTL Examples
/// Local Declarations
Quantities.Quantity Quantity = 12.44 [@Unit, "BL_DataLibraMIB.odx", "km/h"];
Quantities.Unit Unit1;
/// Flow
Unit1 = Quantities.GetBaseUnit(Quantity);