NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sweep Loop - TestStand 2019

For a sweep loop step in TestStand 2019,if we use Array strategy and re-assign the array during run-time, is that supposed to work?
I have a reference to the step. and in the pre-step, I re-assign the ArrayExpr property to Locals.EmptyArray where Locals.EmptyArray is an empty array of strings.

 

My requirement is thus:

The first time the Sweep loop step is run, the ArrayExpr property is set to some array of non-empty values. Now based on some condition during the run, I want this loop to stop, hence writing an EmptyArray to this property. Does not work.

 

If however, I start with Locals.EmptyArray, it works and does not loop, runtime --> does not work.

 

Any ideas would help.

 

Thanks

0 Kudos
Message 1 of 5
(1,192 Views)

No, sweep loop is an edit time feature and not run-time.

 

The number of iterations and the iteration combination values are pre-determined when you configure it during edit-time.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 5
(1,167 Views)

Hi Santhosh,

Thanks for the reply. Then, is there any other way to terminate a sweep loop?
I can set the steps contained within the sweep loop to be skipped, based on the condition, but I don't think thats the right approach.

Thanks

0 Kudos
Message 3 of 5
(1,156 Views)

Hi Santhosh
Regarding the values being set at edit time:
These are my step properties at edit time, the ArrayExpr is set to Step.SweepData["CONFIG_DOPT"].Values, where
Step.SweepData["CONFIG_DOPT"].Values is an string array of 5 values.

 

johndoe858_0-1630775753046.png

When I run it the first time, I am able to set the ArrayExpr = Locals.EmptyArray, and it does work. The value Step.SweepData["CONFIG_DOPT"].Values changes to Locals.EmptyArray. 

(Normally, the first time, the sweep loop will not be terminated, this was just for testing). It does not work during run-time other than the first time.

johndoe858_1-1630775966071.png

 

Thanks

 

0 Kudos
Message 4 of 5
(1,152 Views)

I am not familiar with the internal data structure used by the SweepLoop, you may be able to work around a few things but it would take more effort to poke around to get it working right - because the user was never meant to meddle with the step data structure

 

If you're willing, TS2021 has a more advanced sweep loop with run-time control

https://forums.ni.com/t5/NI-TestStand/Announcing-TestStand-2021/m-p/4173227

 

It saves you a lot of time poking around this Sweep Loop to work for your needs

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 5
(1,147 Views)