NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why i cann't get the executed step index of main segment of a sequence?

Hi, Everyone!

Could someone help me ,Pls?

Query:

        How can i get the executed step index of main segment of a executed sequence?

 

Aim:

       I want to let Teststand reveal the executed step index no matter when it running in main segment, setup segment or cleanup segment when i terminate executing sequence.

 

My action:

      I add a Statement step in SequenceFilePostStep , the content is FileGlobals.GetArrayOffset1= RunState.Sequence.Main.GetArrayOffset("Pass/Fail Test1",0,"0").

      but it cann't work, and it is error.

0 Kudos
Message 1 of 5
(3,983 Views)

I'm not sure exactly what you are trying to do, but your expression is wrong. Try:

 

FileGlobals.GetArrayOffset1= RunState.Sequence.Main.GetArrayOffset("", 0, "[\"Pass/Fail Test1\"]")

 

-Doug

0 Kudos
Message 2 of 5
(3,976 Views)

Dear Doug,

         Thank you for your answer!

         It works ! But what is the meaning of the sign "[\"\"]"?

         Thank you!

0 Kudos
Message 3 of 5
(3,966 Views)

The backslashs are escape characters which tell the expression to interpret the " " as actual quotes. Since the expression Doug posted had other quote marks in it here: ("", 0, "[\"Pass/Fail Test1\"]")  we have to escape the inner quotation marks so that the expression will be interpreted correctly. The backslash does this.

0 Kudos
Message 4 of 5
(3,956 Views)

the [] are because it's array index notiation (see the API help for the API you are trying to call for more details), the inner \"\" are because in order to put the " character inside of a string constant, you need to escape the " character with a \. This is needed so that the parser can tell the difference between a " which means the end of the string constant and a " which is supposed to be part of the string. In many programming languages such as C, C#, and C++ the \ character escapes the character immediately following it.

 

Hope this helps,

-Doug

0 Kudos
Message 5 of 5
(3,955 Views)