04-04-2023 04:49 AM
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"?
Solved! Go to Solution.
04-04-2023 07:52 AM
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
04-05-2023 05:37 AM
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?
04-05-2023 05:59 AM - edited 04-05-2023 06:00 AM
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