ANY_TO_LWORD

The ANY_TO_LWORD instruction converts a value to a 64-bit Long Word value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the
Micro810
LC10,
Micro820
L20E,
Micro850
L50E, and
Micro870
L70E controllers.
ANY_TO_LWORD
ANY_TO_LWORD
ANY_TO_LWORD parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
When set to true, the instruction is enabled.
  • TRUE: Execute the current computation.
  • FALSE: There is no computation.
Applies to ladder diagram programs.
i1
Input
BOOL
SINT
USINT
BYTE
INT
UINT
WORD
DINT
UDINT
DWORD
LINT
ULINT
REAL
LREAL
IME
DATE
STRING
Any value other than a Long Word.
o1
Output
LWORD
A 64-bit Long Word value.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

ANY_TO_LWORD structured text example

(* ST Equivalence: *)
bres := ANY_TO_LWORD (true);
(* bres is 1 *)
tres := ANY_TO_LWORD (t#0s46ms);
(* tres is 46 *)
mres := ANY_TO_LWORD ('0198');
(* mres is 198 *)

Instruction behavior changes starting from firmware revision 23.012

When converting REAL or LREAL values to the LWORD data type, the following rules apply:
  • Positive values
    • Values from 0 through 2⁶³ − 1 can be converted to the LWORD data type.
    • Values exceeding 2⁶³ − 1 are clamped to 2⁶³ − 1.
  • Negative values
    • Values from −1 through −2⁶³ can be converted to the LWORD data type.
    • Values smaller than −2⁶³ are clamped to 2⁶³.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal