From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Meaningful way to identify steps executed in a loop?

Solved!
Go to solution

Hello,

 

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?

 

Thanks!

Certified LabVIEW Developer
0 Kudos
Message 1 of 4
(4,161 Views)
Solution
Accepted by JKSH

Hi,

 

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

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 2 of 4
(4,149 Views)

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.

 

Thanks,

PH

0 Kudos
Message 3 of 4
(4,118 Views)

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
(4,035 Views)