ANY_TO_BYTE

Converts variables to 8-bit BYTE variables
lrso_aby1
Arguments
i1
BOOL - SINT - USINT - BYTE - INT - UINT - WORD - DINT - UDINT - DWORD - LINT - ULINT - LWORD - REAL - LREAL - TIME - DATE - STRING
Any value
o1
BYTE
0 if i1 is FALSE / 1 if i1 is TRUE
number of milliseconds for a timer
integer part for real
decimal number represented by a string
Example
(* FBD example with "Convert to BYTE" Operators *)
lrso_aby2
(* ST Equivalence: *)
bres := ANY_TO_BYTE (true);
(* bres is 1 *)
tres := ANY_TO_BYTE (t#0s46ms);
(* tres is 46 *)
mres := ANY_TO_BOOL ('0198');
(* mres is 198 *)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal