NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically name of module step type

Solved!
Go to solution

Hi,

 

We are several people creating test sequences in TestStand and we use the same code modules, we have a problem where we name these step differently but use the same code module. Meaning that in one test sequence the testname could be RTC-Test and in another test sequence the name could be RTC Test, but the code base used during test is the same.

We would like to have the same step-name for the same code module (the name which the code module have), is there any way to control the step name in teststand to match the code module name automatically?

If not what is the best practice for this type of problem.

 

Thanks for your input!

 

 

0 Kudos
Message 1 of 7
(1,215 Views)

Executing a helper sequence file:

 

use the API to scan through the desired sequence files looking for LabVIEW Actions or Tests.

Once you find a Step, extract the code module name and changed the StepName accordingly.

 

Semi-Automatic:

Implement a sequence analyzer test which scans the desired sequences and identify those, where VI name does not correspond the step name. Change them manually.

 

Both approaches require the programmer to do something after coding 

 

Just be aware that your desired policy will impose limitations on readablity of the sequence/ will affect reusablity of your code modules...

 

If you need to run the same VI multiple times, your test report will show the same test name multiple times as well

 

 

 

0 Kudos
Message 2 of 7
(1,185 Views)

I tinkered a bit with the StepName:

 

the Sequence Editor interprets Step  Properties -> General -> Name as a string, so there is no use putting an expression in there.

 

What works, is for example to have the Step Pre-Expression set to something like

 

Step.Name = Step.Module.ViCall.VIPath

 

So the step name would be changed during run time, but again additional actions are needed to save those modifications.

 

 

0 Kudos
Message 3 of 7
(1,181 Views)

Thank you for your input, this is actually C# code modules and have tried using different approaches with a post expression statement, the closes thing i was able to get was the Class name by setting:
Step.Name = Step.Module.ClassName

But would like to get the method name.

Maybe there is another extension to use to get the method name?

Thank you for you answers this put me in the right direction! 😊

0 Kudos
Message 4 of 7
(1,163 Views)

Hi Isabell

please take a look a this old thread.
https://forums.ni.com/t5/NI-TestStand/how-to-crate-an-action-step-in-teststan-using-C-along-with/td-...

on last page there an example that creates a .net step.

Hope that helps

Juergen

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 7
(1,154 Views)
Solution
Accepted by topic author isabell_L

Hi
just realized that example not working in TS2020.
DotNetModule.LoadPrototypeFromMetadataToken is obsolete!
Now updated to DotNetCall.LoadPrototypeFromSignature

For your task step name to 1.Membername in post expression
Step.Name = Step.Module.AsDotNetModule.Calls.Item(1).MemberName


will do the trick

Hope that helps
Juergen



--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 6 of 7
(1,146 Views)

Thank you for your answer, this was very helpful and did the trick as you say 😀

Have a nice day!

Best Regards,

Isabel

0 Kudos
Message 7 of 7
(1,139 Views)