NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Rename step using parameter of caller subsequence

Solved!
Go to solution

I have a call to subsequence called "ena". The sequence "ena" accepts parameter nemed "one" of type Number. I call this subsequence with variable (Locals.pet which holds value 5) and I want to rename the step in report as:

Step.Name = "Calling subsequence using parameter one's value " + Step.TS.SData.ActualArgs.one.Expr.

This would result in step name reported as "Calling subsequence using parameter one's value Locals.pet". How to modify report to get step named as "Calling subsequence using parameter one's value 5"?

 

0 Kudos
Message 1 of 4
(812 Views)
Solution
Accepted by topic author VArh

Step.TS.SData.ActualArgs.one.Expr is an expression. To achieve what you want to do, you need to evaluate the expression.

https://www.ni.com/docs/de-DE/bundle/teststand/page/tsfundamentals/infotopics/evaluate.html

 

This should do the job

 

Message 2 of 4
(800 Views)

Great, that works - i.e.: 

Step.Name = "Calling subsequence using parameter one's value " + Str(Evaluate(Step.TS.SData.ActualArgs.one.Expr)

evaluates in report as:

"Calling subsequence using parameter one's value 5"

 

Sub question:

If passed passed variable is enum, how could I evaluate enum name and value in step name?

i.e.:

Step.Name = "Calling subsequence using parameter one's value " + Str(Evaluate(Step.TS.SData.ActualArgs.one.Expr)

would evaluate (when variable is enum) as:

"Calling subsequence using parameter one's value controlling"

I would also like to display value of it, like:

"Calling subsequence using parameter one's value 5 (controlling)"

Is this also possible?

0 Kudos
Message 3 of 4
(764 Views)

Good question, I had to look this up myself.  I was surprised to find the answer to be intriguingly simple....

Just use the Str() function to convert the enum variable value into a string 

Message 4 of 4
(759 Views)