NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically configure multiple numeric limit test measurements

 

I seek to dynamically (programatically) configure a multiple numeric limit test such that I may set / increase / change the number of measurements in the step during execution. For example, I'd like to setup the step for 5 measurements:

 

M1, M2, M3, M4, M5 with limits 4<=x<=13.

I'll set the result data to {1,2,3,4,5}.

 

I can successfully set:

MyMultipleNumLimTestStep.ExpectedNumMeas = 5

MyMultipleNumLimTestStep.NumericArray (Number of elements to 5)

MyMultipleNumLimTestStep.DataSourceArray (Number of elements to 5)

MyMultipleNumLimTestStep.Result.Measurement (Numer of elements to 5)

 

Following that, I can access the individual measurement property objects (by offset) and set the Name, Limits.Low, Limits.High, etc...

During execution, I can view the step variables to see the values getting set correctly.

 

BUT, in the report, I only see measurement name, status and the measurement value. NOT the units, limits, comparison type.

 

Step Status Measurement Units Limits
Low Limit High Limit Comparison Type
AmpMatchTest Failed          
Measurement:
M1 Failed 1.000
M2 Failed 2.000
M3 Failed 3.000
M4 Passed 4.000
M5 Passed 5.000

 

 

Take note, prior to execution, I have no entries defined in the Limits tab of the step settings for this step. If I were to define, say, two steps and run again:

 

Step Status Measurement Units Limits
Low Limit High Limit Comparison Type
AmpMatchTest Failed          
Measurement:
M1 Failed 1.000 dB 4 13 GELE(>= <=)
M2 Failed 2.000 dB 4 13 GELE(>= <=)
M3 Failed 3.000
M4 Passed 4.000
M5 Passed 5.000

 

If I define >5 entries, my code will limit the result to 5. Any ideas?

 

Thanks,

Derek

 

0 Kudos
Message 1 of 7
(6,858 Views)

Derek,

 

I can't remember what I wrote this example for back in the day but I believe it does what you want.  I was looking through some old examples and saw it.  In the MainSequence there is a local.  Just insert more elements into that array to dynamically change how many measurements show ont he report for the multi numeric step.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 7
(6,828 Views)

Hi jigg.

 

I also need to configure a multiple numeric limit test programatically. Unfortunately your solution seems not to work (in Teststand 2013). Also with your code I get limits and comparsion entries in the report only for the first measurement. This is the one already existing in the step configuration.

 

Step Status Measurement Units Limits
Low Limit High Limit Comparison Type
Dynamic Call Passed          
Measurement:
AllParts Passed 1 1 = Pass 1   EQ(==)
Another Part Passed 1
Part 20 Passed 1
Part 2 Passed 1
Part 1 Passed 1

 

If I add a second measurement in the step, this one is shifted (like expected) and shows the limits and comparsion in the report.

 

Step Status Measurement Units Limits
Low Limit High Limit Comparison Type
Dynamic Call Failed          
Measurement:
AllParts Passed 1 1 = Pass 1   EQ(==)
Another Part Passed 1
Part 20 Passed 1
Part 2 Passed 1
Part 1 Passed 1
Measurement 1 Failed 0 1 = Pass 1   EQ(==)

 

What is special with the preconfigured measurements, compared to the programatically created test? Any help is very appreciated.

 

Thanks

--rainer

 

 

0 Kudos
Message 3 of 7
(6,641 Views)

Hey Rainer,

 

It's possible that you aren't setting the IsLimit flag for the new PropertyObjects that correspond to the new measurements. The existing measurements will have this set (if you right-click the Limits container and choose Advanced > Edit Flags, you will see that "Is Limit" is checked). This tells the reporting code to include the data as a test limit.

 

You can set this for your new PropertyObjects by using the SetFlags command. If IsLimit is the only flag you want to set, you can just pass 0x1000 as the flags argument, or if you want to set multiple flags you can OR them together.

Message 4 of 7
(6,615 Views)

Thank you Daniel. This is the information I was looking for. Now I am able to create multiple numeric tests programatically.

 

I'll append the VI. Maybe this can ease somebodys job.

Message 5 of 7
(6,599 Views)

 


@railang wrote:

Thank you Daniel. This is the information I was looking for. Now I am able to create multiple numeric tests programatically.

 

I'll append the VI. Maybe this can ease somebodys job.


It was very useful ...
Thanks a lot

0 Kudos
Message 6 of 7
(4,183 Views)

Hi Rainer,

 

Thanks for sharing this VI. It works great at specifying the names of the measurements and the limit values for existing measurements, specified for the step in TestStand.

 

However, it does not add measurements. For example, if I have 5 measurements already specified for the step, this VI will change the names and values of (up to) 5 measurements. But If I use it to configure 6 measurements dynamically, it throws the following error.

 

Error -17309 occurred at You cannot create a subproperty in an item that is not a container.
Error accessing item 'Step.Result.Measurement[3].Limits.Low'. in TestStand - Set Property Value (Number).vi

 

Thanks,

Ravi

0 Kudos
Message 7 of 7
(2,332 Views)