Difference between revisions of "Core.Terms.EncodeInteger"
Jump to navigation
Jump to search
m (Hb moved page EncodeInteger to Core.Terms.EncodeInteger: #3153) |
|||
Line 1: | Line 1: | ||
− | [[Category:Core]] | + | {{DISPLAYTITLE:OTX '''EncodeInteger'''}}[[Category:Core]] |
== Classification == | == Classification == | ||
{{ClassificationActivity | EncodeInteger | Returns a ByteFieldwhich contains the encoded value of the original Integer argument. | [[Term]] | [[Core|OTX Core library]] | [[Integer conversion terms]] | [[OutOfBoundsException]] | - }} | {{ClassificationActivity | EncodeInteger | Returns a ByteFieldwhich contains the encoded value of the original Integer argument. | [[Term]] | [[Core|OTX Core library]] | [[Integer conversion terms]] | [[OutOfBoundsException]] | - }} | ||
Line 12: | Line 12: | ||
also provides control over the byte order which be used for encoding. | also provides control over the byte order which be used for encoding. | ||
− | {{TermReturnValue| [[ByteField]] | The decoded ByteField value of the Integer argument}} | + | {{TermReturnValue| [[Core.DataTypes.ComplexDataType.ByteField|ByteField]] | The decoded ByteField value of the Integer argument}} |
== Properties == | == Properties == | ||
Line 20: | Line 20: | ||
{{TableRowPropertie2| EncodingSize | [[EncodingSize]] | [[Value]] | @EncodingSize:64-BIT | [1] | Specifies how many bits shall be used for the encoding. <nowiki>EncodingSize = {8-BIT|16-BIT|32-BIT|64-BIT}</nowiki>}} | {{TableRowPropertie2| EncodingSize | [[EncodingSize]] | [[Value]] | @EncodingSize:64-BIT | [1] | Specifies how many bits shall be used for the encoding. <nowiki>EncodingSize = {8-BIT|16-BIT|32-BIT|64-BIT}</nowiki>}} | ||
{{TableRowPropertie1| ByteOrder | [[Endianness]] | [[Value]] | @Endianness:LITTLE-ENDIAN | [1] | Specifies the byte order which shall be used when writing the encoded Integervalue into the resulting ByteField. <nowiki>Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}</nowiki>. LITTLE-ENDIAN is the default value.}} | {{TableRowPropertie1| ByteOrder | [[Endianness]] | [[Value]] | @Endianness:LITTLE-ENDIAN | [1] | Specifies the byte order which shall be used when writing the encoded Integervalue into the resulting ByteField. <nowiki>Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}</nowiki>. LITTLE-ENDIAN is the default value.}} | ||
− | {{TableRowPropertie2| Integer | [[Integer]] | [[Term]] | - | [1] | Represents the Integer value which be converted to ByteField.}} | + | {{TableRowPropertie2| Integer | [[Core.DataTypes.SimpleDataType.Integer|Integer]] | [[Term]] | - | [1] | Represents the Integer value which be converted to ByteField.}} |
|} | |} | ||
Line 31: | Line 31: | ||
== See also == | == See also == | ||
− | [[DecodeInteger]] | + | [[Core.Terms.DecodeInteger|DecodeInteger]] |
Revision as of 03:37, 5 February 2016
Contents
Classification
Name | EncodeInteger |
Short Description | Returns a ByteFieldwhich contains the encoded value of the original Integer argument. |
Class | Term |
Extension | OTX Core library |
Group | Integer conversion terms |
Exceptions | OutOfBoundsException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
ByteFieldTerm = Conversion.EncodeInteger(EncodingType, Endianness, IntegerTerm);
Description
EncodeInteger term returns a ByteField which contains the encoded value of the original Integer argument. For the encoding, n-bit unsigned, n-bit signed-binary or n-bit two's complement representation of the integer can be chosen, where be chosen out of 8, 16, 32 and 64bit. The term also provides control over the byte order which be used for encoding.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
ByteField | The decoded ByteField value of the Integer argument |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
EncodingType | EncodingType | Value | @EncodingType:64-BIT | [1] | Specifies how the Integer value be encoded. EncodingType = {UNSIGNED|SIGNED-BINARY|TWOS-COMPLEMENT} |
EncodingSize | EncodingSize | Value | @EncodingSize:64-BIT | [1] | Specifies how many bits shall be used for the encoding. EncodingSize = {8-BIT|16-BIT|32-BIT|64-BIT} |
ByteOrder | Endianness | Value | @Endianness:LITTLE-ENDIAN | [1] | Specifies the byte order which shall be used when writing the encoded Integervalue into the resulting ByteField. Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}. LITTLE-ENDIAN is the default value. |
Integer | Integer | Term | - | [1] | Represents the Integer value which be converted to ByteField. |
Examples
ByteField result;
result = EncodeInteger(@EncodingType:TWOSCOMPLEMENT, @EncodingSize:16BIT, @Endianness:LITTLEENDIAN, -256);
//Returns the result = 00 FF