NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get TestSocket Index in Display Execution Callback

Solved!
Go to solution

Hello everyone,

 

I am developing custom OI for multi thread test system. I need to display 10 execution views on the interface.

I have found an example available in the forum, but I need to get Test Socket Index to be able correctly assign the Execution Views.

The example I have found on the forum on how to access socket index is giving error for some reason. The screen shot of Display Execution Callback VI is attached. Please help to understand the error.

Download All
0 Kudos
Message 1 of 5
(3,603 Views)
Solution
Accepted by topic author Levon

Eyeballing it, the top part of your code looks close.  Try changing "Parameters.TestSockets.Index" to "RunState.Root.RunState.TestSockets.MyIndex" or "RunState.TestSockets.MyIndex"

 

Note that if you create non-socket executions, you might want to check that

RunState.Root.ThisContext.Locals.UUT exists to determine if you are in a socket execution.

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

Hello James,

Sorry but neither  "RunState.Root.RunState.TestSockets.MyIndex" nor "RunState.TestSockets.MyIndex" worked.

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

This works in a watch expression at a breakpoint: thiscontext.AsPropertyObject().GetValNumber("Runstate.TestSockets.MyIndex", 0), so we can't be too far off.

 

To debug it, you could wire your error outs and probe them to make sure you are making it to the GetValNumber. You could then change it to GetProperyObject and start shortening the lookup string until you find the first part that doesn't give an error.

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

This one worked. I don't know why it doesn't worked first time Parameters.TestSocket.Index.

 

Thank you.

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