STRING_TO ConversionsΒΆ

Converting from the variable type STRING to a different type:

The operand from the STRING type variable must contain a value that is valid in the target variable type, otherwise the result will be 0.

Examples in IL:

(* Result is TRUE *)
LD 'TRUE'
STRING_TO_BOOL
ST b

(* Result is 0 *)
LD 'abc34'
STRING_TO_WORD
ST w

(* Result is T#127ms *)
LD 't#127ms'
STRING_TO_TIME
ST t

Examples in ST:

(* Result is TRUE *)
b :=STRING_TO_BOOL('TRUE');

(* Result is 0 *)
w :=STRING_TO_WORD('abc34');

(* Result is T#127ms *)
t :=STRING_TO_TIME('T#127ms');

Examples in FBD:

../_images/343f15fe69c76bb20a317d316db299b6
../_images/588ff8c669c78c7b0a317d31042b8541
../_images/2c7dddde69c7b1580a317d312df2ed50