-

TO_LWORD

Type Function
Description The overloaded function TO_LWORD converts an input value of various data types into an output value of the data type LWORD (see description of the input for the supported data types).
Parameters Input

IN

Output

OUT
Conversion rules
  • The conversion is done by copying the input value bitwise to the output value, i.e., a binary transfer from the input data type to the output data type is performed.

    The bit order/bit meaning of LREAL values complies with the IEC 60559 standard. Here, the basic double width floating format is defined. This bit order is copied unchanged to the output LWORD.

  • LREAL input value: The LREAL_TO_LWORD conversion complies with the latest standardization by the IEC 61131-3, 3rd edition.
  • If the input data type is smaller than the LWORD output, the "unused" bits of the LWORD are set to FALSE (e.g. bits 8 to 63 for BYTE_TO_LWORD or SINT_TO_LWORD).
  • If the range and precision of the input data type can be mapped to the range and precision of the output type, an implicit type conversion can be performed instead of using this function.
    For the TO_LWORD function, this applies to BOOL, BYTE, WORD and DWORD inputs.
STRING conversion
Error behavior Error behavior
Examples Examples in ST
Additional information EN/ENO behavior