From emotive
Jump to navigation Jump to search


Name ToByteField
Short Description Converts an OTX term to a value of the ByteField data type
Class Term
Extension OTX Core library
Group Conversion terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

ByteFieldTerm ToByteField(Term)


This term will return the ByteField counterpart of the argument term.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
ByteField Returns the ByteField counterpart of the argument term.


  • Boolean
    Returns the 0x01, if true , otherwise 0x00.
  • Integer
    Returns the smallest possible two's complement representation of the integer (using the smallest possible number of bytes). Concerning byte order in the resulting ByteField, little endian will be used. With this, e.g. 127 converts to 1-byte 011111112 (0x7F), -127 to 100000012 (0x81), whereas 6719 converts to 2-byte 001111112 000110102 (0x3F 0x1A), -129 to 011111112 111111112 (0x7F 0xFF), and so on. Therefore, the size of the resulting ByteField depends on the input integer's magnitude.
  • Float
    Returns the 64-bit double precision encoded value according to IEEE 754:2008.
  • ByteField
    Returns the copy of the value.
  • String
    Returns the UTF-8 encoded value.


Name Data Type Class Default Cardinality Description
Term - Term - [1] Represents the OTX term that will be converted to a new value of the ByteField data type. See conversion rule descriptions above.


/// Local Declarations

ByteField ByteField1;
ByteField ByteField2;
ByteField ByteField3;
ByteField ByteField4;
ByteField ByteField5;

/// Flow

ByteField1 = ToByteField(true);
ByteField2 = ToByteField(123);
ByteField3 = ToByteField(123.456);
ByteField4 = ToByteField(&18 00 FF FF);
ByteField5 = ToByteField("123");

See also