NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming a test step

Solved!
Go to solution

Hi Community,

 

I have a step in a for loop and I'd like to rename it in every iteration (eg: Test 1, Test 2, Test 3 etc). 


What I have noticed is that if I create a pre-expression to change the Step.Name then the in runtime the displayed step name changes only once it's execution is completed.

 

I thought that its because I change the name as a pre-expression, after the step started to execute, so I created a step before which tries changing the Runstate.Nextstep.Name parameter, but - to my surprise - the effect is the same, the step name changes only after its done with the execution.

 

This is confusing for the user, so would you mind helping me out with how to change the name of the step in a way that it changes the name before it starts executing the code its calling?

 

thanks!

0 Kudos
Message 1 of 10
(1,865 Views)

I cannot reproduce the issue you describe. Please compare with attached code.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 10
(1,848 Views)

Just replace the Statement step with a Wait. Copy the expression you had in Statement and set the wait time to 5s.

 

When you run the sequence then you'll that in the first iteration TS displays "Wait" and not test0, then in the 2nd iteration it will display test0, while it indeed executes "test1" etc.

0 Kudos
Message 3 of 10
(1,846 Views)

Nope, works as expected. There is something different wrong on your machine...

StepRenameReport.PNG

 

EDIT: Ah, i see... your statement does not refer to report, but to the execution view.

Point is that tracing only updates the position of the execution arrow and the step which has just executed. Because of this, you won't see any modification of "future steps". To work around this, you can manually send an UI Message "Trace" in the renamed step after renaming has been done.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 10
(1,836 Views)

Ok... could be my PC. Pls set a 10s wait time and check what do you see in the first iteration. I see "Wait" instead of Test0. Once the wait is over, the name changes to test0 and it also logs correctly to the report file.

 

I am using TS2016.

0 Kudos
Message 5 of 10
(1,833 Views)

Never did that... what would the the right UI message?

thanks.

0 Kudos
Message 6 of 10
(1,829 Views)
Solution
Accepted by topic author 1984

UIMsg_Trace

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 7 of 10
(1,827 Views)

Alright, that solves the problem, thanks.

 

Is there a way to somehow do this with one step? Cause right now I need two, one statement which does the rename and the trace and the step I'd like to execute. It would be nice if I could save the statement step.

 

0 Kudos
Message 8 of 10
(1,824 Views)
Solution
Accepted by topic author 1984

Use a pre-expression like

Step.Name="Step"+Str(Locals.Index),
RunState.Thread.PostUIMessageEx(UIMsg_Trace,0,"",Nothing, False)

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 10
(1,818 Views)

Perfect!!! Thanks.

0 Kudos
Message 10 of 10
(1,815 Views)