Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 5 out of 5     Rate this Document

Loop Index for Interactive Execution in TestStand

Primary Software: TestStand
Primary Software Version: 4.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am running an interactive execution by right-clicking the steps and selecting Loop on Selected Steps... Is there a method to retrieve the loop index of the execution?

Solution:
Interactive loop index is not directly exposed by any objects in TestStand. One workaround is to use the step.GetStepSettingsString() method. During interactive execution, this method will return a string in the format below, with X being the loop index.

    Interactive (X)

You need to perform additional string manipulation to retrieve X. Note that the loop index will be included in the step setting string only if the loop count is greater than 1.
 
This method requires a reference to a step as an input. You can use the sequence context to get a reference to the sequence, and then the step. In addition, the InteractiveArgs object contains the step indices that are included in the interactive execution.

A simple example is attached below to demonstrate this process. To use it, simply select all the steps in the sequence, right-click, and select Loop on Selected Steps...

Related Links:
KnowledgeBase 2D4ET2O6: How Can I Use the Run Selected Steps and Loop On Selected Step Options Using Any Execution Entry Point?

Attachments:

InteractiveExecSample.seq






Report Date: 02/06/2008
Last Updated: 06/05/2009
Document ID: 4I59QJM6

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit