STRING_TO conversionsPermalink

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 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:

string_to_bool
string_to_word
string_to_time