Open Test Framework  
Literals

A literal (Latin littera "letter") denotes a character string used to directly represent the values of data types. In order for literals to be identified, they must conform to certain syntactical rules, e.g. B. be enclosed in quotation marks like "This is a string".

List of Literals

Inside OTF all literals has OTL syntax, see Expressions. The following list contains literal examples in OTL syntax of all OTX data types which support literals. Detailed information about the literals can be found in the definition of the OTX data type.

Core

OTX Data Type OTL Literal Example Notes
Boolean true
false
Not case sensitive
Integer -9223372036854775808
-2
0
1
9223372036854775807
Float -2.56899
-1.03344
0.0
-0.0
0.0125
NaN
-Infinity
String "Hello"
"abc0123!@#$%^"
"\n"
"\xhhhh "
"Line1\r\nLine2"
Case sensitive
ByteField &0A
&0F10
&0123456789ABCDEF
&NULL
Not case sensitive except &NULL for empty byte field
List {"literal of list", "with type has literals"}
{&01, &02, &FF}
{{{1,2}, {3,4}}, {{1,2}, {3,4}}}
Map {"Key1" : "literal of map with value type has literals"}
{1 : &01, 5 : &02, 2 : &FF}
{"k1" : {1, 2, 3}}
{1 : {"key1" : true, "key2" : false}, 2 : {"k1" : true}}
UserException @UserException:"Indentifier"/"ExceptionText"
@UserException:"SelfDefinedException1"/"Incorrect data input."
Empty Value NULL The element in an expression is omitted

DataType Extension

OTX Data Type OTL Literal Example Notes
Enumeration Color.Red
MyEnumerationSignature1.MyEnumerationElement1
Structure Address{name = "Sherlock Holmes", street = "Baker Street", code = 221, city = "London"}
MyStructurSignature1{Element1 = true, Element2 = {1, 2, 3}}

Quantity Extension

OTX Data Type OTL Literal Example Notes
Quantity 12.53 [@Unit, "D:/ODX_RS_UNIT_LIB.odx", "(km/h)/s", 3]
37.5 [@Unit, "ODX_RS_UNIT_LIB.odx", "°", 2]
Unit [@Unit, "ODX_RS_UNIT_LIB.odx", "1/min2"]
[@Unit, "Z:/ODX_RS_UNIT_LIB.odx", "kΩ"]

HMI Extension

OTX Data Type OTL Literal Example Possible Values
ConfirmationType @ConfirmationType:YES { YES | NO | CANCEL }
MessageType @MessageType:INFO { INFO | WARNING | ERROR | YESNO_QUESTION | YESNOCANCEL_QUESTION }

i18n Extension

OTX Data Type OTL Literal Example Notes
TranslationKey @TranslationKey:"text_ID_value"
@TranslationKey:"Key01"

Logging Extension

OTX Data Type OTL Literal Example Possible Values
LogLevel @LogLevel:ALL { ALL | TRACE | DEBUG | INFO | WARN | ERROR | FATAL | OFF }
SeverityLevel @SeverityLevel:TRACE { TRACE | DEBUG | INFO | WARN | ERROR | FATAL }

StringUtil Extension

OTX Data Type OTL Literal Example Possible Values
Encoding @Encoding:ISO-8859-1 { US-ASCII | ISO-8859-1 | UTF-8 | UTF-16BE | UTF-16LE | UTF-16 | BIN | OCT | HEX }

DiagCom Extension

OTX Data Type OTL Literal Example Possible Values
ResponseState @ResponseState:FAILED { FAILED | INVALID | NEGATIVE | POSITIVE }
ResultState @ResultState:ALL_NEGATIVE { ALL_FAILED | ALL_INVALID | ALL_NEGATIVE | ALL_POSITIVE | FAILED | INVALID | NEGATIVE | POSITIVE }

DiagDataBrowsing Extension

OTX Data Type OTL Literal Example Possible Values
ComChannelCategory @ComChannelCategory:BASE_VARIANT { BASE_VARIANT | FUNCTIONAL_GROUP | PROTOCOL }

DiagDataBrowsingPlus Extension

OTX Data Type OTL Literal Example Possible Values
McdDataType @McdDataType:ASCIISTRING { ASCIISTRING | BITFIELD | BOOLEAN | BYTEFIELD | FLOAT32 | FLOAT64 | INT16 | INT32 | UINT64 | INT8 | UINT16 | UINT32 | UINT64 | UINT8 | UNICODE2STRING | DTC | END_OF_PDU | ENVDATA | ENVDATADESC | FIELD | KEY | LENGTHKEY | MULTIPLEXER | NO_TYPE | STRUCT_FIELD | STRUCTURE | TABLE | TABLE_ROW | TEXTTABLE }
McdParameterType @McdParameterType:CODED_CONST { CODED_CONST | DYNAMIC | GENERATED | LENGTH_KEY | MATCHING_REQUEST_PARAM | NRC_CONST | PHYS_CONST | RESERVED | SYSTEM | TABLE_ENTRY | TABLE_KEY | TABLE_STRUCT | VALUE }
McdResponseType @McdResponseType:GLOBAL_NEG_RESPONSE { GLOBAL_NEG_RESPONSE | LOCAL_NEG_RESPONSE | POSITIVE_RESPONSE }

Flash Extension

OTX Data Type OTL Literal Example Possible Values
Audience @Audience:SUPPLIER { SUPPLIER | DEVELOPMENT | MANUFACTURING | AFTERSALES | AFTERMARKET }
FlashFileFormat @FlashFileFormat:BINARY { BINARY | SREC | INTEL }