OTX Reference  
OpenTestSystem.Otx.Core.Terms.EncodeInteger Class Reference

Encodes an Integer More...

Inheritance diagram for OpenTestSystem.Otx.Core.Terms.EncodeInteger:
Inheritance graph

Public Attributes

Endianness byteOrder
 Specifies the byte order which be used when writing the encoded Integer value into the resulting ByteField. The most widely used byte order LITTLE-ENDIAN is the default. More...
 
EncodingSize encodingSize
 Specifies how many bits be used for the encoding. Since the OTX Integer datatype is 64 bit, an encoding size of 64-BIT is the default value. More...
 
EncodingType encodingType
 Specifies how the Integer value be encoded. The most widely used encoding called two's complement is the default. More...
 
IntegerTerm integer
 Represents the Integer value which shall be converted to ByteField. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Store additional More...
 

Detailed Description

Encodes an Integer

The 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.

Exceptions
Core.Exceptions.OutOfBoundsExceptionIt is thrown if the number of bits required for encoding the Integer value exceeds the number of bits specified by the encodingSize attribute(overflow).
Syntax
ByteFieldTerm = Conversion.EncodeInteger(EncodingType, Endianness, IntegerTerm);
Examples
// Local Declarations
ByteField result;
// Flow
//Returns the result = 00 FF
result = EncodeInteger(@EncodingType:TWOSCOMPLEMENT, @EncodingSize:16BIT, @Endianness:LITTLEENDIAN, -256);

Member Data Documentation

◆ byteOrder

Endianness OpenTestSystem.Otx.Core.Terms.EncodeInteger.byteOrder

Specifies the byte order which be used when writing the encoded Integer value into the resulting ByteField. The most widely used byte order LITTLE-ENDIAN is the default.

◆ encodingSize

EncodingSize OpenTestSystem.Otx.Core.Terms.EncodeInteger.encodingSize

Specifies how many bits be used for the encoding. Since the OTX Integer datatype is 64 bit, an encoding size of 64-BIT is the default value.

◆ encodingType

EncodingType OpenTestSystem.Otx.Core.Terms.EncodeInteger.encodingType

Specifies how the Integer value be encoded. The most widely used encoding called two's complement is the default.

◆ integer

IntegerTerm OpenTestSystem.Otx.Core.Terms.EncodeInteger.integer

Represents the Integer value which shall be converted to ByteField.