NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Callback on inserting a custom step type into a sequence

Solved!
Go to solution

Hi,

We have several custom steps in different folders under Templates (TestStand 2019). When  a user drops a step from the template onto the sequence, I want to be able to run code that verifies that the name of the step dropped into the sequence is not used anywhere else in the sequence. Is there a call back sequence I can use to do the same and then have code in the callback to do this? Or some other method?

For example: I have StepType1 in the Templates folder, when I drag and drop this into the sequence, the name of the step will be StepType1.

If I put another instance of this step in the sequence, it should be renamed to StepType1_Something.

Thanks
  

0 Kudos
Message 1 of 3
(1,397 Views)
Solution
Accepted by topic author johndoe858

Hello,

 

You can create your own function and write place it on each custom step's substep named OnNewStep.

This is a custom substep, which will run the code, when the step is inserted from the Insertion Palette.

 

Built-in OnNewStep function is the one which puts the End step after you inserted For/While....

https://zone.ni.com/reference/en-XX/help/370052AA-01/tsfundamentals/infotopics/step_type_prop_subste...

 

CsBihacker

0 Kudos
Message 2 of 3
(1,365 Views)

Thanks, just learnt that from an NI support engineer as well. Added a OnNewStep custom step to my custom step type and works as expected. Will mark your solution as accepted as well.

Thanks a lot.

0 Kudos
Message 3 of 3
(1,362 Views)