ANY_TO_LREAL
Converts variables to a long REAL variable.

Arguments | ||
---|---|---|
i1 | BOOL - SINT - USINT - BYTE - INT - UINT - WORD - DINT - UDINT - DWORD - LINT - ULINT - LWORD - REAL - LREAL - TIME - DATE - STRING | Any value |
o1 | LREAL | 0.0 if i1 is FALSE / 1.0 if i1 is TRUE number of milliseconds for a timer equivalent number for integer |
Example
(* FBD example with "Convert to Long REAL" Operators *)

(* ST Equivalence: *)
bres := ANY_TO_LREAL (true); | (* bres is 1.0 *) |
tres := ANY_TO_LREAL (t#1s46ms); | (* tres is 1046.0 *) |
ares := ANY_TO_LREAL ('198'); | (* mres is 198.0 *) |
Provide Feedback