NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple numeric limit test

Solved!
Go to solution

Hi all,

 

I have a question about Multiple Numeric Limit Test.

 

My data source is an array tab1[ ].

I need to compare each item of tab1[ ] with the associated item in another array tab2[ ].

In other words, I would like to check wether tab1[i] > tab2[i] (for i = 0 ; i > 32 ; i++)

 

Simple problem isn't it ? However, I can't find any efficient solution to specify my "Low Limit" expression ! ^^

To be more precise, I have to say that I don't want to create 32 different "Low Limit" expressions (Low Limit A = tab2[0] Low Limit B = tab2[1] , etc... would be a bad solution). I would like to create a single expression that would be able to handle all the comparisons at the same time. Is it possible ?

 

Thank you very much for any help !

 

0 Kudos
Message 1 of 5
(4,585 Views)
Solution
Accepted by topic author Julien_31

I think the easiest thing to do in this use case would be to use a regular numeric limit step with loop settings enabled. Your data source would be set to something like:

 

Locals.tab1[RunState.LoopIndex]

 

And the comparison type would be GT with the low limit set to:

 

Locals.tab2[RunState.LoopIndex]

 

You can set the loop settings on the step to "Fixed number of loops" with 32, or you can use custom loop type based on fixed number of loops with the Loop While expression set to something like:

 

RunState.LoopIndex < GetNumElements(Locals.tab1)

 

Hope this helps,

-Doug

Message 2 of 5
(4,562 Views)

Thank you very much for your help Doug. OK for your solution ! 🙂

 

I understand by reading your answer that using the "Multiple Numeric Limit Test" is not so easy in my use case. So your solution is good, but let me explain what I have done to solve my problem (I'm OK with your solution but I'm a beginner with TS and I would like to improve, so I try to use different techniques to solve my problems) :

> I added a "Statement" step just before the "Multiple Numeric Limit Test" step.

> In this "Statement" step, I use TS API to create dynamically the 32 measurements of the "Multiple Numeric Limit Test" step, and it works very well.

> The only problem is the report generated : for each measurement, there are my results but there are also information that I do NOT want to log ! ^^ For instance, the expressions that I use for calculating Low and High Limits are logged into the report (!). Those information are not logged when I don't create the 32 measurements dynamically. So I tried to use SetFlags() function of TS API to set the "Include In Report" flag to false. But the expressions remain in the report. Any idea ? (maybe I should create another topic ?)

0 Kudos
Message 3 of 5
(4,553 Views)

Use PropFlags_DontCopyToResults instead of PropFlags_IncludeInReport. If you create the measurements with the UI and then look at their flags in the variables view (e.g. Step.Result.Measurement["Measurement 0"].Limits.HighExpr), you will see that it's using the PropFlags_DontCopyToResults flag.

 

-Doug

Message 4 of 5
(4,548 Views)

Merveilleux ! You're right.

Thank you again for your help.

J.

0 Kudos
Message 5 of 5
(4,525 Views)