07-11-2011 02:49 PM
Why can't I do a logical OR when evaluating a String Value? I added a string Value Test. I want to see if it equal to either of two string expressions. I went to the Limits tab and tried to enter a function in the Expected String Value: "Test 1" || "Test 2" but get an error (Specified value does not have the expect type). Seems like a pretty basic thing to want to evaluate but looks like only able to evaluate against one string?
BTW - searching with OR in your expression in the NI boards does not play well... hence O_R.
07-11-2011 03:48 PM
The string value test only compares to a single value. That expression is evaluated, so "String A" || "String B" has no meaning, since it's trying to OR two strings, which is not possible. It then tries to compare to this result. This is why you are getting an error, there is no valid way to OR the strings.
If you want something more complicated, like comparing to two values, you have a few options:
1) Use a Pass/Fail test. You could store the string value in a variable, add it as an additional result. For the Pass/Fail Condition, you would specify Locals.Foo == "Val1" || Locals.Foo == "Val2".
2) Create a new step type that allows you to specify multiple correct values.