Comparing 2 strings
-
I'm looking for a function block comparing two strings and generate a logic output of "1" when equal and "0" if NOT equal.
But I could not find a string function block that is doing that. I noticed the STOR block and tried to convert to real and compare the real values, but the output of the STOR block is always "0" so when comparing that with another string that was converter to Real is not working.
I guess I might have overlooked another function block that I need for this purpose.Any feedback on this will be appreciated.
Best regards,
Peter -
Hi Peter,
thanks for interesting question. It is possible to compare two strings comparing their length and position of one substring in the other one - see attached .mdl file.
PS: function block for comparing strings is on our todo list
Regards, Tomas
-
@cechurat
Thanks a lot Tomas,
I will have a look at the example later this afternoon.Thanks and best regards
-
-
@rexpeter You are welcome Glad I could help.
Cheers, Tomas