Strings

For string data types, the following syntax applies:

"…" [:<length of the string>]

Example: "abc":3

This means that the string abc has a maximum length of 3 characters. When no value for the length is entered, the maximum length value matches the current length of the string. For example, message would have a length of 7.

A value entered between brackets [] is optional.

Use quotation marks to write a single-line string, see (1) in Figure "Single-line and multi-line string in step lists". To write a multi-line string, use three quotation marks. To perform a line break, press Alt+Enter.

Single-line and multi-line string in step lists

When the maximum value of a string data type is exceeded, a compile and runtime error occurs. Consider the channels a and b, where a = "aaaaa": 5 and b = "bbb": 3. The operation b : = a results in a runtime error because a > b.

String data types can be used with the Exe Platform, the C/C++ Platform and the FUSION Platform. In the MATLAB Platform string data types can only be applied to the parameter signal type.

The string data type length is limited to 215-1. The warning "The specified value '"":256524' does not match type 'string'." appears if you try to enter a string value > 215-1.
String values are always displayed with a dimension specification.

A string value can be applied to an int8-array or uint8-array using the Channel step or Parameter step. The string length must comply with the number of array elements, see Data Types - Arrays.

The text characters are encoded according to ISO-8859-1. When using int8[] the character codes 128...255 are represented by their complementary values (-128...-1).