ANY_TO_BYTE

The ANY_TO_BYTE instruction converts a value to an 8-bit Byte value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
ANY_TO_BYTE
ANY_TO_BYTE
ANY_TO_BYTE 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
INT
UINT
WORD
DINT
UDINT
DWORD
LINT
ULINT
LWORD
REAL
LREAL
TIME
DATE
STRING
Any non-Byte value.
o1
Output
BYTE
An 8-bit Byte value.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

ANY_TO_BYTE structured text example

(* ST Equivalence: *)
bres := ANY_TO_BYTE (true);
(* bres is 1 *)
tres := ANY_TO_BYTE (t#0s46ms);
(* tres is 46 *)
mres := ANY_TO_BYTE ('0198');
(* mres is 198 *)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal