04-10-2010 12:25 PM
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
04-12-2010 10:18 AM
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
04-12-2010 12:18 PM
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
04-13-2010 08:46 AM - edited 04-13-2010 08:48 AM
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
04-14-2010 04:41 AM
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
04-14-2010 07:35 AM
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
04-14-2010 09:50 AM
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
04-14-2010 10:23 AM
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
04-15-2010 09:10 AM
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
04-15-2010 09:31 AM
I want to get the actual values returned from or passed into the code modules.
Best regards