NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting current Step Name of MainSequence in parallel Sequence

Solved!
Go to solution

Hi,

 

I'm starting a sequence in parallel from the MainSequence by "Using new execution". This parallel sequence is continously polling CPU performance data from my UUT and logs them "on the fly" to an Excel-file while the MainSequence is running the test case.

 

To get a clear reference from the UUTs CPU performance to the test steps, I need to get somehow the step name of the currently executed test step in the MainSequence for logging it together with the CPU performance data.

 

Is there any possibility to identify the current step of the main sequence in the parallel sequence (e.g. by any property)?

 

Thanks in advance,

 

MRet

 

 

0 Kudos
Message 1 of 7
(6,386 Views)

Hi MRET,

 

i think the solution is described under the following link.

 

Getting the Name of Any TestStand Property Programmatically in TestStand

http://digital.ni.com/public.nsf/allkb/AC5008A6FC55616F86256BBC005B61D8

 

Regards,

Lars

Message 2 of 7
(6,361 Views)

What version of TestStand are you using? There isn't really a thread safe way to do what you are asking until TestStand 2013. In TestStand 2013 you can do the following if you pass a thread reference for the thread you are monitoring into your worker execution:

Locals.CurrentlyExecutingStepName = Parameter.threadToMonitor.AsThread.GetSequenceContext(0, Locals.notUsed).AsPropertyObject.GetPropertyObject("Step", 0).Name

And set the above step which does this to ignore errors because you will get an error if there isn't currently a step running. It will however fail with an error whenever execution in the thread is currently between steps (this could happen at any time since you are checking asynchronously), though you could retry a few times.

Prior to TestStand 2013, monitoring subproperties of property objects that were being changed structurally (i.e. child/parent or array element insertion, renaming, and removal - In this case, the "Step" subproperty of the sequence context) in another thread in parallel was not threadsafe and could result in unexpected errors which could put the process in a bad state.

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 7
(6,281 Views)

Hi Doug,

 

We are currently waiting for the update from TestStand 2012 to TestStand 2013. Afterwards I will try to get it running using your proposal...

 

Thanks,

 

Rette01

0 Kudos
Message 4 of 7
(6,216 Views)

Hi Doug,

 

we finally have updated to TestStand 2013 and try to use your example.

 

We do have some problems in getting the thread reference, which is replaced by "threadToMonitor" in the expression you have posted, as far as I understand.

 

The thread to monitor is the MainSequence. So, how do I get a reference to the MainSequence?

 

Regards,

 

Rette01

0 Kudos
Message 5 of 7
(6,127 Views)
Solution
Accepted by Rette01

@Rette01 wrote:

Hi Doug,

 

we finally have updated to TestStand 2013 and try to use your example.

 

We do have some problems in getting the thread reference, which is replaced by "threadToMonitor" in the expression you have posted, as far as I understand.

 

The thread to monitor is the MainSequence. So, how do I get a reference to the MainSequence?

 

Regards,

 

Rette01


 

Pass RunState.Thread as a parameter to the sequence call. The parameter should be specified as an object reference variable.

 

-Doug

0 Kudos
Message 6 of 7
(6,119 Views)

Ok, now it works!

 

Thanks a lot!

0 Kudos
Message 7 of 7
(6,093 Views)