08-19-2014 06:43 AM
Hello All,
Working in TestStand 2013, and came across a situation with DMM measurements, in which several values would be acceptable for the limit comparison. For example, if I am making a resistance measurement, and I expect it to be a very high value, say greater than 1M, I would insert that as the lower limit. However, there are also certain situations when I may see the result of "NaN" at the meter. For the purposes of the test, any number greater that 1M would be acceptable, but a result of NaN would also be acceptable. In an effort to keep the code modular and reusable for many instances, I am curious if there is a way in TestStand to compare the test result against two values at the same time, (i.e. >1M OR =NaN). Please advise. Thanks.
GSinMN
Solved! Go to Solution.
08-19-2014 08:01 AM
put this as your low limit:
Step.Result.Numeric == NAN ? NAN : 1000000
Hope this helps,
08-19-2014 09:15 AM
Excellent. Never used the "Conditional" operator before. Now I know how. Thanks.
GSinMN
08-21-2014 01:30 PM
Hello Again,
Tried the conditional operator by manually setting the limits (hard coding), and it appeared to work properly. However, my objective test application is a little more complicated. I actually read the limits from a configuration file, and inject them into the test step by use of the "TestStand - Set Property Value" function.
I have tried to inject the expression as a string, but when the step runs, it expects a number in order to set the limit, and an error occurs. I know of functions that will convert simple decimal strings to numbers, but I am unaware of one that can handle an expression that includes the conditional operator.
Looks like I either need to find a way to convert a complex string into a number, or I need to find a way to make the limit field accept a string from Labview. I see there is also an option in the "Set Property Fuinction" for an object type, but I am unfamiliar with how that is used. Any ideas? Please advise. Thanks again.
GSinMN
08-21-2014 02:14 PM
Probably because you are trying to set the Low limit property. You need to set the Low Limit Expression property and set the Use Expression flag to true.
Consider the screen shot attached. If UseLowExpr is False then the Low numeric property is used. If it is True then the LowExpr property is used.
Hope this helps,
08-21-2014 02:31 PM
Yes, that's exactly what I was doing. Thanks for the correction. You're awesome, as usual.
GSinMN
08-21-2014 04:31 PM
Thank you for the kind words. I'm glad it is working.