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: