NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Meaningful way to identify steps executed in a loop?

Go to solution



I have a set of tests, where I apply a voltage to many different pins (sequentially) while checking the response for each pin on a CAN bus. I implemented the tests in a loop, like this (pseudo-code):


paramsArray = initParamsFromFile()

For_each (params in paramsArray) Apply params.voltage to params.pinId Test canValue == params.expectedResponse End


paramsArray is an array of 50 containers (LabVIEW clusters), which is populated from values in a file. Each array element contains a pin ID, a voltage to apply, and a value to expect from the CAN bus.


However, in the log, the tests for all 50 pins end up with exactly the same Step Name and Step ID (I'm using the default TestStand table schemas).


So my questions are:

  1. Is this a good way to implement a repetitive set of tests?
  2. What's a good way to distinguish the different (repeated) steps in my log?



Certified LabVIEW Developer

0 Kudos
Message 1 of 4
Accepted by topic author JKSH



1.) It is ok, you can do that because it will keep your sequence small as possible and (fast).
    But you could  also use the For-Each StepType so others will see more better the loop behaviour
    The looping feature is a little bit more "hidden" in the settings-field. In large sequences this is
    is often overlooked. It is just your choise. I am using both stuff.


2.) Just rename the step name in the PreExpression field by using the LoopIndex
     Step.Name ="MyName:"+ Str(RunState.LoopIndex+1)


Hope this helps



NIWeek 2017: Standardized HIL Test Automation With TestStand
NIWeek 2016: Capturing ATE Requirements With Requirements Gateway

Feedback or kudos are welcome
Message 2 of 4

If you are using the reportext, I have added information in that field to distinquish the step in the loop.


Step.Result.ReportText = " Something meaningful' to recognize the step.


The downside if you get another field in the report.  That would add up to 50+ more lines that could be an issue if you want a small report.


But I like j_dodek's idea of renaming the step on the fly. Smiley Very Happy That is probably the route I would go.




0 Kudos
Message 3 of 4

Juergen, that's perfect! Thank you. 🙂


PH, I'd want to use the ReportText field to store other things too, so I'd need to do extra parsing to extract the step ID. The Failure Chain doesn't show the ReportText either. Thank you for your suggestion though.

Certified LabVIEW Developer

0 Kudos
Message 4 of 4