plc - Is mixing types allowed in ST (Structured Text) -
i wonder if allowed standard (iec 1131-3) mix different data types in expression.
example
var : bool; b : int; (* ... *) if (b , c) ... end_if
you must use explicit type conversion functions when converting "down" in types. "up" conversion done implicitly.
var : bool; b : int; (* ... *) if (int_to_bool(b) , c) ... end_if
there forms of these type conversion in form of typea_to_typeb()
Comments
Post a Comment