NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to get the name of the Main Sequence test running to send back to LabVIEW?

Hi,

I am currently trying to get the name of my Main Sequence tests being run and send the name over to my LabVIEW GUI interface for a custom progress bar. However, I am relatively new to TestStand and I am having some difficulty figuring out how exactly to do this as well as determining the time for each step to run in my Main Sequence.

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

Hi,

 

the name of your Main sequence is always Main Smiley Wink

 

If you need information for any steps in your current sequence you can access them via ThisContext.Runstate.Sequence subproperties.

Have a break on first step of your sequence and check in variables view, what is availabel

0 Kudos
Message 2 of 7
(4,739 Views)

Hi Oli.

Thank you for your response and from what I understand from what your saying I can get the name of my current testing running via ThisContext.Runstate.Sequence.Main?

So for an example if I have 3 tests running within my Main Sequence and I want the name of the current test running I can use this current expression:

Locals.TestName = NameOf(ThisContext.RunState.Sequence.Main)

Where my "TestName" is a string in my Locals to hold the current test name, which will get overwritten whenever a new test is executed. For an example if I had Test1, Test2, and Test3 in my Main Sequence it would return in my locals string as Test1 when executing, then overwrite Test1 with Test2, when Test 2 is executing?

0 Kudos
Message 3 of 7
(4,735 Views)

If you want to send the name of your Main Sequence tests over to the LabVIEW UI then the prescribed way of doing this would be using User Interface Messages.

 

There's a good introduction to UI Messages here: Using TestStand User Interface Messages (UI Messages)

 

Typically, you will need to:

 

1. Define a custom UIMessage, eg. UIMsg_UserMessageBase+1, to use in both the TestStand and LabVIEW

2. Call a PostUIMessage(UIMsg_UserMessageBase+1, TestName) to send the UI the TestName

3. Add a Callback VI to receive the UI Message and pass in any references to controls (eg. custom progress bar) you wish to update

4. Add a case in the Callback VI for UIMsg_UserMessageBase+1 and modify the control with the received TestName

 

All this should be described in the link above.

 

I hope this gets you started.

 

Regards,

 

Charlie

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 4 of 7
(4,729 Views)

Hi Charlie,

I have reviewed your link that you have suggested and we do indeed have the same solution to process and execute the message protocols. I am working with some VI's that someone has given me as an example. What I am trying to do is to create and expression that simply determines, which test in my Main Sequence that is currently running and store that into a string variable, which I would then send over via my protocol. I am having difficulty trying to make the expression as this is new to me.

My expression is the following:
Locals.TestName = NameOf(ThisContext.RunState.Sequence.Main)

The idea is to have a Local named TestName and the function would get the name of the current test running in my Main Sequence. 

For an example I have TestA, TestB, TestC in my Main Sequence and I would like to know the name of which test is running at the time.

0 Kudos
Message 5 of 7
(4,725 Views)

Does this work for you?

 

Locals.TestName = RunState.Sequence.Name

 

Regards,

 

Charlie

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

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

Hi Charlie,

If run that current script wouldn't I get the name of the current step running rather than the Main Step? For an example if I was running TestA and it was calling a sub-test of TestAa, would the name coming back to my variable be TestAa, which is a sub-sequence I called or the Main Sequence. I have attached an image of a basic test I am trying to conduct in order to get the name of my test. I am trying to use that script to obtain the Test_POS1 and not the sub-step that it calls, which would be Stepper_POS1.

Main Sequence Name.jpg

0 Kudos
Message 7 of 7
(4,716 Views)