NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get change step ID number to step name

I have got the step precondition property from Labview to call teststand API,and it displayed "RunState.Sequence.Main["ID#:pTQkFY0jO0mNgc2jMHGLSC"].Result.Status != "" && RunState.Sequence.Main["ID#:pTQkFY0jO0mNgc2jMHGLSC"].Result.Status != "Skipped"",and I want to know how to convert ID number:pTQkFY0jO0mNgc2jMHGLSC to step name which I can identify.
Message 1 of 5
(5,278 Views)
You need a reference to the Sequence the step is in first.  You can then call:
Sequence.GetStepByUniqueID(uniqueID).

Allen P.
NI
0 Kudos
Message 2 of 5
(5,277 Views)

Hello AllenP,I  can understand you answer,but I do not know how to get it.The picture is a segment of my operator interface,I want to realize a run select step use single pass button,and when user click this button,the program check the selected step whether have precondition or not,If the selected step have precondition,the program prompt to the user which precondition he must select,and now I can get the precondition string,but this string is the step ID number,I do not know how to convert this ID number to step name.

Thank you for your help!

0 Kudos
Message 3 of 5
(5,261 Views)
Since you have a step, you can get the sequence reference from it by dropping a Property Node, wiring the Step object to it, and selecting "Sequence".  From this, you can then put an invoke node, wire the Sequence into it, and then call the method I described above.

I noticed you are only checking 1 of the selected steps.  If you select 2 or more steps, your program will only check the first one.  Is this what you want to do?  You might want to check every step in a for loop, or not allow this option to run if more than 1 steps are selected.

Allen P.
NI
0 Kudos
Message 4 of 5
(5,252 Views)
Thank you for your help,now I can get the step name,and thank you for you advise.
0 Kudos
Message 5 of 5
(5,246 Views)