OTX Reference
|
|
Data types determine the value range of declarations. More...
Classes | |
class | Boolean |
Boolean value, which can be either true or false . More... | |
class | ByteField |
Sequence of Bytes with arbitrary length. More... | |
class | ComplexType |
Abstract data type of all complex data types. More... | |
class | CountableType |
Abstract data type of all countable data types. More... | |
class | DataType |
Abstract data type of all data types. More... | |
class | Float |
Floating point numbers. More... | |
class | Integer |
Integer numbers. More... | |
class | List |
List of items of the same data type. More... | |
class | Map |
Dictionary of key/value pairs. More... | |
class | MutexLock |
An OTX MutexLock controls entry to all MutexGroups which refer to it. More... | |
class | SimpleType |
Abstract data type of all simple data types. More... | |
class | String |
Arbitrary number of characters. More... | |
Enumerations | |
enum class | EncodingSize { Item8BIT , Item16BIT , Item32BIT , Item64BIT } |
Number of bits for the encoding of an Integer More... | |
enum class | EncodingType { UNSIGNED , SIGNEDBINARY , TWOSCOMPLEMENT } |
Encoding type of Integer. More... | |
enum class | Endianness { LITTLEENDIAN , MIXEDENDIAN , BIGENDIAN } |
Byte order for writing encoded Integer. More... | |
Data types determine the value range of declarations.
Data types determine the value range of Declarations or the return types of Terms. Data types usually define additional Terms or Actions to process the values. Here is an Overview of all data types.
OTX defines a fixed set of data types. A distinction is made between the following groups of data types.
Simple data types are all basic data types such as Boolean, Integer, Float and String. Countable data types can be used as keys (e.g. key of a Map). Complex data types are all other data types. such as ByteField, ComChannel and DiagService. List and Map are generic data types with any nesting depth. A List is a table with elements of the same data type that can be accessed via an index, e.g. List<List<Integer>>
. A Map is a list of key-value pairs that are accessed via a key, e.g. Map<String, List<Integer>>
. The user can define user-defined data types himself using a Signature. An enumeration is a list of integer values that are assigned to a name, e.g. Enumeration Color(Red = 0, Green = 1, Blue = 2)
. The structure consists of a list of elements with any number of different data types in any nesting depth, e.g. Structure Person(String FirstName, String LastName, Integer Age, Color EyeColor)
. Each OTX extension can define new data types.
Each data type can also define the following terms depending on its use:
Term
(e.g. BooleanTerm)Literal
(e.g. BooleanLiteral))True
Value
(e.g. BooleanValue))In addition, data types define terms for creation (e.g. ListCreate), the explicit conversion to other data types (e.g. ToBoolean), access to certain values of the data type (e.g. GetExceptionText) as well as terms for data type specific operations (e.g. BitwiseNot).
Data Type | Sample (OTL) |
---|---|
Boolean | True or False |
Integer | 1200 or +1200 or -12 |
Float | 12.345 or NaN or -Infinite or -0 |
String | "Hello World" |
ByteField | &01020304EFFF or &FF |
List | { 1, 2, 3 } or { "Text1", "Text2", "Text3" } |
Map | { { "Key1":"Value1" }, { "Key2":"Value2" }, { "Key3":"Value3" } } |
implicit type conversion
. Except for this exception, data types must always be converted explicitly (Explicit Type Conversion
). Every conversion from one data type to another data type (e.g. from Integer to String) must be done using a suitable conversion term, e.g. ToBoolean, ToInteger, ToFloat, ToString, ToByteField.
|
strong |
Number of bits for the encoding of an Integer
Specifies how many bits are used for the encoding.
|
strong |
Encoding type of Integer.
Specifies how the Integer value shall be encoded (examples using BIGENDIAN byte order).
Enumerator | |
---|---|
UNSIGNED | Encoding type unsigned. The Integer will be written to the ByteField, using all available bits (including the sign-bit). For negative integers, its absolute value will be encoded. With this encoding, an Integer value of e.g. |
SIGNEDBINARY | Encoding type signed. With this encoding, the first bit in the resulting bytes will mark the sign; the other bits encode the absolute value. According to this, e.g. |
TWOSCOMPLEMENT | Two's complement encoding. The Integer will be encoded according to the most widely used encoding called two's complement. With this encoding, an Integer value of e.g. |
|
strong |
Byte order for writing encoded Integer.
Specifies the byte order which shall be used when writing the encoded Integer value into the resulting ByteField. The most widely used byte order LITTLEENDIAN is the default.
MSB_FIRST_MSW_LAST
or MSB_LAST_MSW_FIRST
. Byte Order | n | n + 1 | n + 2 | n + 3 | n + 4 | n + 5 | n + 6 | n + 7 |
---|---|---|---|---|---|---|---|---|
MSB_FIRST_MSW_LAST | Byte1 | Byte0 | Byte3 | Byte2 | Byte5 | Byte4 | Byte7 | Byte6 |
MSB_LAST_MSW_FIRST | Byte6 | Byte7 | Byte4 | Byte5 | Byte2 | Byte3 | Byte0 | Byte1 |
MSB_FIRST | Byte7 | Byte6 | Byte5 | Byte4 | Byte3 | Byte2 | Byte1 | Byte0 |
MSB_LAST | Byte0 | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 | Byte7 |