LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI question

Hi,
I'm developing a subVI which reads an input string, compares it with some strings (string1..) that I want to match and returns a numeric value with the following values:
-1 if string1 matched
-2 if string2 matched
....
I've tried to do this by calling the Match Pattern vi 4 times in parallel and then using 4 if structures, but when I try to wire the results from each of the ifs to the final return result I get some errors.
Please tell me how can I solve that or advise me on a better method for implementing this VI
0 Kudos
Message 1 of 3
(2,434 Views)
Create an array of all you strings as a diagram constant and then use "search array":
 
 
 


Message Edited by altenbach on 05-21-2008 11:36 PM
0 Kudos
Message 2 of 3
(2,425 Views)

Hi vici4u, and if your string only has to contain the strings your are searching for, then use a loop with the match pattern function.

Mike



Message Edited by MikeS81 on 05-22-2008 08:41 AM
0 Kudos
Message 3 of 3
(2,421 Views)