OTX Reference  
OpenTestSystem.Otx.Core.DataTypes.ByteField Class Reference

Sequence of Bytes with arbitrary length. More...

Inheritance diagram for OpenTestSystem.Otx.Core.DataTypes.ByteField:
Inheritance graph

Public Attributes

ByteFieldLiteral init
 Initialisation of a ByteField declaration More...
 

Detailed Description

Sequence of Bytes with arbitrary length.

An OTX ByteField is an arbitrary length sequence of bytes. Each byte is an unsigned eight bit value with a value space ranging from 0x00 to 0xFF (0 to 255). The bytes in a ByteField of byte size n are ordered from left to right, where the leftmost byte have a byte index of 0 and the rightmost byte have a byte index of n-1. The bits in each byte of the ByteField are ordered from the least significant bit (LSB) to the most significant bit (MSB).

OTX ByteField values can be used to store raw data in memory representation which is used in the ECU. There is no assumption made for any interpretation of that raw data. A ByteField can therefore describe any kind of data, from simple integer data up to encoded text etc.

Note
If a ByteField declaration is not explicitly initialized, an empty ByteField is created and assigned to the ByteField.
Terms and Actions
List of some useful terms and actions:
Conversion Terms
ConversionResultSample
ToBooleanReturns false if empty, otherwise true
Boolean b = ToBoolean(&0123); // Returns true
ToIntegerReturns the Integer value of the ByteField
Integer i = ToInteger(&7B); // Returns 123
ToFloatReturns the Float value of the ByteField (interpretation according to [IEEE 754:2008])
Float f = ToFloat(&405EDD2F1A9FBE77); // Returns 123.456
ToStringReturns the UTF-8 interpretation of the ByteField
String s = ToString(&313233); // Returns "123"
ToByteFieldReturns the copy of the value
ByteField bf = ToByteField(&0123); // Returns &0123
Syntax Declaration
ByteField Declaration [= ByteFieldLiteral];
Literal
Ampersand followed by hexadecimal characters. The number of characters must be divisible by 2 without a remainder. An empty ByteField is specified as &NULL.
&XXXX
Sample
ByteField ByteFieldVariable1 = &NULL; // Empty ByteField
ByteField ByteFieldVariable1 = &00FF; // ByteField with 2 bytes
ByteField ByteFieldVariable1 = &1fab3e50; // ByteField with 4 bytes

Member Data Documentation

◆ init

ByteFieldLiteral OpenTestSystem.Otx.Core.DataTypes.ByteField.init

Initialisation of a ByteField declaration

This optional element stands for the initialisation of the ByteField at declaration time. If a ByteField declaration is not initialized, an empty ByteField will be assigned.