Difference between revisions of "Core.Terms.DecodeInteger"
Jump to navigation
Jump to search
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:Core]] | + | {{DISPLAYTITLE:OTX '''DecodeInteger'''}}[[Category:Core]] |
== Classification == | == Classification == | ||
− | {{ClassificationActivity | DecodeInteger | | + | {{ClassificationActivity | DecodeInteger | Returns the decoded Integer value of the ByteField argument. | [[Term]] | [[Core|OTX Core library]] | [[Integer conversion terms]] | [[Core.Actions.Throw.Exception.OutOfBoundsException|OutOfBoundsException]] | - }} |
== OTL Syntax == | == OTL Syntax == | ||
Line 11: | Line 11: | ||
'''DecodeInteger''' term returns the decoded Integer value of the ByteField argument. The term provides control over the byte order which be used for decoding as well as the way how the ByteField be decoded regarding n-bit unsigned, n-bit signed binary or n-bit two's complement interpretation, where nis the ByteField's size multiplied by 8 (in other words: the total number of bits in the original ByteField). | '''DecodeInteger''' term returns the decoded Integer value of the ByteField argument. The term provides control over the byte order which be used for decoding as well as the way how the ByteField be decoded regarding n-bit unsigned, n-bit signed binary or n-bit two's complement interpretation, where nis the ByteField's size multiplied by 8 (in other words: the total number of bits in the original ByteField). | ||
− | {{TermReturnValue| [[Integer]] | The decoded Integer value of the ByteField argument}} | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | The decoded Integer value of the ByteField argument}} |
== Properties == | == Properties == | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| EncodingType | [[EncodingType]] | [[Value]] | @EncodingType: | + | {{TableRowPropertie1| EncodingType | [[EncodingType]] | [[Value]] | @EncodingType:TWOS-COMPLEMENT | [1] | Specifies how the bytes of the ByteField be interpreted. <nowiki>EncodingType = {UNSIGNED|SIGNED-BINARY|TWOS-COMPLEMENT}</nowiki>}} |
{{TableRowPropertie2| ByteOrder | [[Endianness]] | [[Value]] | @Endianness:LITTLE-ENDIAN | [1] | Specifies the byte order which be respected prior to decoding the ByteField value. <nowiki>Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}</nowiki>. LITTLE-ENDIAN is the default value.}} | {{TableRowPropertie2| ByteOrder | [[Endianness]] | [[Value]] | @Endianness:LITTLE-ENDIAN | [1] | Specifies the byte order which be respected prior to decoding the ByteField value. <nowiki>Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}</nowiki>. LITTLE-ENDIAN is the default value.}} | ||
− | {{TableRowPropertie1 | Bytes | [[ByteField]] | [[Term]] | - | [1] | Represents the ByteField value which be converted to Integer.}} | + | {{TableRowPropertie1 | Bytes | [[Core.DataTypes.ComplexDataType.ByteField|ByteField]] | [[Term]] | - | [1] | Represents the ByteField value which be converted to Integer.}} |
|} | |} | ||
Line 29: | Line 29: | ||
== See also == | == See also == | ||
− | [[EncodeInteger]] | + | [[Core.Terms.EncodeInteger|EncodeInteger]] |
Latest revision as of 08:23, 26 April 2019
Contents
Classification
Name | DecodeInteger |
Short Description | Returns the decoded Integer value of the ByteField argument. |
Class | Term |
Extension | OTX Core library |
Group | Integer conversion terms |
Exceptions | OutOfBoundsException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
IntegerTerm = Conversion.DecodeInteger(EncodingType, Endianness, ByteFieldTerm);
Description
DecodeInteger term returns the decoded Integer value of the ByteField argument. The term provides control over the byte order which be used for decoding as well as the way how the ByteField be decoded regarding n-bit unsigned, n-bit signed binary or n-bit two's complement interpretation, where nis the ByteField's size multiplied by 8 (in other words: the total number of bits in the original ByteField).
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Integer | The decoded Integer value of the ByteField argument |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
EncodingType | EncodingType | Value | @EncodingType:TWOS-COMPLEMENT | [1] | Specifies how the bytes of the ByteField be interpreted. EncodingType = {UNSIGNED|SIGNED-BINARY|TWOS-COMPLEMENT} |
ByteOrder | Endianness | Value | @Endianness:LITTLE-ENDIAN | [1] | Specifies the byte order which be respected prior to decoding the ByteField value. Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}. LITTLE-ENDIAN is the default value. |
Bytes | ByteField | Term | - | [1] | Represents the ByteField value which be converted to Integer. |
OTL Examples
Integer result;
result = Conversion.DecodeInteger(@EncodingType:TWOSCOMPLEMENT, @Endianness:LITTLEENDIAN, &00 FF);
//Returns the result = -256