01-24-2014 02:29 PM
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:
If I define >5 entries, my code will limit the result to 5. Any ideas?
Thanks,
Derek
01-27-2014 08:16 AM - edited 01-27-2014 08:16 AM
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,
04-06-2014 05:12 PM - edited 04-06-2014 05:13 PM
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.
If I add a second measurement in the step, this one is shifted (like expected) and shows the limits and comparsion in the report.
What is special with the preconfigured measurements, compared to the programatically created test? Any help is very appreciated.
Thanks
--rainer
04-07-2014 08:29 AM
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.
04-08-2014 07:00 AM
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.
05-19-2017 04:16 AM
@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
12-04-2020 03:07 PM
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