NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use method GetCaptionText

Dear all,
I'd like to use this method to get some information of the current execution as metioned in Help of this method.
I don't understand how to set input parameter of formatExpression.
For example, I need TestSocketIndex of the present execution, and got nothing while:
formatExpression = ""
or formatExpression = "%1"
or formatExpression = "%TestSocketIndex%"

 

Thank you for any advice!

0 Kudos
Message 1 of 4
(3,033 Views)

Hello labc good afternoon,

 

Thank you for contacting the forum support from NI, based on your question I would suggest that you refer to the TestStand help in the tab index and search for the CaptionSources Enumeration where it refers to the CaptionSource_MacroExpression, I think this can give a good example on how to use the instruction.

 

If you want to check the TestSocketIndex I would suggest to use the following value "RunState.TestSockets.MyIndex".

 

I hope that this information is useful,

 

Best Regards, 

 

CaEnOs

0 Kudos
Message 2 of 4
(3,013 Views)

Hi, CaEnOs,

I can get TestSocketIndex with the Expression you post in TestStand Edit envirment.

Now what I want to do is to get this information in a customized UI we are developing. Likely there are 2 ways:

1, use expression or variable in TestStand edit envirment, and then get expression value with a TS methor or property.

   I don't know how to get express value in this way.

2, use method of GetCaptionText what I am confued.

    I can get Username with this method, but get nothing of TestSockectIndex in callback of EndExecution while I'm running 2 executions in parallel.

 

I failed to do anyone above and could you give me a example?

0 Kudos
Message 3 of 4
(3,006 Views)

Some updates, I can get TestSocketIndex by using UI massage callback.

Using properties of Event and NumbericData of object uimessage,NumbericData is TestSocketIndex if NumbericData=UIMsg_ModelState_Initializing

0 Kudos
Message 4 of 4
(2,947 Views)