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

Convert expression to ByteField More...

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

Public Attributes

Term term
 The expression (term) to be converted to ByteField More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Store additional More...
 

Detailed Description

Convert expression to ByteField

The ToByteField term returns the ByteField equivalent of the argument. It returns 0x01 for Boolean true and 0x00 for false. If the argument is Integer, it returns the the smallest possible two's complement representation of the value with little-endian. If the argument is Float, it returns the value encoded with 64-bit double precision according to IEEE 754:2008 and String the UTF-8 encoded value.

Rules

  • 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.
Syntax
ByteFieldTerm = ToByteField(Term)
Examples
// 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");

Member Data Documentation

◆ term

Term OpenTestSystem.Otx.Core.Terms.ToByteField.term

The expression (term) to be converted to ByteField