-

TO_WSTRING

Type Function
Description Converts an input value into an output value of the data type WSTRING. The format string applied to the FORMAT input is used to format the output string, i.e., how the output string is represented.
Notes
  • When the string output is longer than 80 characters and the FU is directly connected to another FU, temporary string variables of size 80 are used. Calculation/usage will fail. If the result of the operation is longer than 80 characters, then a 'String too short' message will be logged and the output is set to an empty string or the last valid value is kept, respectively. Use an intermediate local variable in-between.
  • The input value is not checked for validity. In case of an error (see error behavior below), the program execution continues and a string error is written to the Online log in the MESSAGES window.
  • The function is an overloaded function. It can operate on various input data types.
Parameters Inputs

IN

FORMAT

Output

OUT
Format string The format string can contain placeholders (format specifier, precision specifier) for the generated output string. The specifiers define how the output value is represented. Using the format string, the output string can be formatted according to special requirements.

The format string uses the following syntax:

     {0[:format_specifier][precision]}

(The curly brackets are mandatory. Optional parameters are enclosed by square brackets.)

Numeric format specifiers

Character format specifiers

Date and Time format specifiers

Precision

Default format specifiers
Error behavior Error behavior
Additional information EN/ENO behavior