NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Run single step in for each loop

Hi,

 

Is it possible to run a single step in a for each loop? My loop in the main sequence iterates over an array of 50 structs, that decides what step in the for each loop should run.

 

The main sequence looks sort of like this:

 

For each(of the 50 structs)

        Select

            Case TestThis

               Test 1

            Case TestThat

                Test 2

            Case TestOther

                Test 3

            Case TestAll

                Test 4

 

The struct contains some variables for the test and the name of the test to run.

So, lets say I would like to run a test using the startup and cleanup part of the sequence, but I'd only like to use the data in array number 24, which contains TestOther, so it should run Test 3 with the appropriate data. 

 

Is it possible to have a VI open in the start up faze and let the user choose a number, 1 - 50, and then run the loop once with the data from this struct?

 

Thanks 

0 Kudos
Message 1 of 4
(2,685 Views)

You can use a VI to do that operation.Needs extra effort.

 

A simpler way will be to use the message box step type.

Go to options and enable the response text.

 

The user entered value (text) will be stored in step.result.response.

 

You can use a val function to convert it to number and proceed further with your loop.

0 Kudos
Message 2 of 4
(2,679 Views)

Thanks for your input.

 

So when I have the number stored in step.result.respons, how do I get the for each loop to only run that number in the list?

0 Kudos
Message 3 of 4
(2,677 Views)

you can put a statement step to copy this to a local.num variable

In your switch statement you can use the locals.num as the arguement.

0 Kudos
Message 4 of 4
(2,669 Views)