NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get the RunState.ThisContext and step properties after double clicking a step in the Execution_tab in run mode.

I am using the TestStand User Interface (C#) and have placed a breakpoint in the sequence.
When the sequence starts and reaches the breakpoint, I want to get information from a specific step after double clicking the step.

I want to get the current RunState.ThisContext and all specific details from the step. (The information that is viewed in the variable pane after selecting ‘Show Step in Variables’)
I want to use this data in a C# code module to do some calculations.

 

private void axExecutionSteps_DblClick(object sender, EventArgs e)
{
     // RunState.ThisContext and step properties needed to pass them to a C# code module

      ... ???
}


Does anyone know if this is possible?

 

Best regards

0 Kudos
Message 1 of 12
(4,613 Views)

You can get the context from the ExecutionViewMgr.SequenceContext property. This property will be updated whenever a trace or break UIMessage occurs and also whenever a user changes the active callstack level while at a breakpoint, thus you should NOT hold onto this sequence context, but instead get it from this property whenever you need it.

 

Hope this helps,

-Doug

 

0 Kudos
Message 2 of 12
(4,591 Views)

Thanks Doug,

 

I am now able to get the sequence context, but is it also possible to get all details (parameters from the step...) from the step on which has been clicked?

 

Best regards

0 Kudos
Message 3 of 12
(4,589 Views)

1a) ExecutionViewMgr.SelectedSteps

Or

1b) SequenceView.FocusIndex or SequenceView.HitTest() with the current mouse location depending on your preference (behavior will be slightly difference) then SequenceView.ItemIndexToStep then use results of that with SequenceContext.Sequence.GetStep

2) Step.Module

 

Then it depends on the adapter, for example:

 

LabVIEWModule.Parameters for LabVIEW

DotNetModule.Parameters for .NET

 

-Doug
Message Edited by dug9000 on 04-13-2010 08:48 AM
0 Kudos
Message 4 of 12
(4,569 Views)

Thanks for the tips...

 

I am close to the solution, but now I struggle with the LoadPrototypeFromMetadataToken method, this method returns always false. I assume this is correct based on the help documentation from NI.
But the number of parameters is always zero for my dotNetModule?


Attached, my method to retrieve the parameters from a DotNetModule, everything works as expected until the method LoadPrototypeFromMetadataToken is executed.

 

Any help will be highly appreciated.

 

Best regards

0 Kudos
Message 5 of 12
(4,548 Views)

Hi Doug,

 


I was able to get all the DotNetParameters from my dotnet method!


(The problem was related to my step type definition. The default module in the general tab has to be specified with the appropriate method)

 

Finally, I want to retrieve the data from my parameter. I suppose the dotNetParameter.AsPropertyObject().GetPropertyObject… method has to be used to get the data from each parameter

 

Do you have an example how to do this?

 

Best regards

0 Kudos
Message 6 of 12
(4,544 Views)

What do you mean by retrieve data from the parameter? Do you want to get the argument that was specified or the result of the call after it executes for the output parameters? The output values aren't stored on the parameter, they are stored whereever you specified in your argument expressions. You can log these values using "additional results" though in the step settings panel's additional results section for the step.

 

If what you meant was just getting the expressions for the argument values you can get those from the DotNetParameter.ValueExpr property.

 

Please clarify what you are trying to do and why and I might be better able to help.

-Doug

0 Kudos
Message 7 of 12
(4,535 Views)

Hi Doug,

 

Attached a screenshot to clarify...

 

I am using the TestStand User Interface application.
I have put a breakpoint in my sequence, and then executed the sequence until the breakpoint is reached.
When double clicked on an instance of my step type ‘Excel’ (In the screenshot ‘Add values to Excel) I want to get the values from my parameters in a code module.
In the screenshot sample, I want to get the value from parameter ‘SourceCode’ (MSExcel[Version{Major.1;Minor.0;}Settings{TF.Locals.Boolean…), the same for the other parameters.

The parameter 'SourceCode' is an in/out parameter

Best regards

0 Kudos
Message 8 of 12
(4,532 Views)

Again, it's still not completely clear, do you want to get the expressions specified for the parameters or the actual values returned from or passed into the code modules?

 

-Doug

0 Kudos
Message 9 of 12
(4,500 Views)

I want to get the actual values returned from or passed into the code modules.

 

Best regards

0 Kudos
Message 10 of 12
(4,494 Views)