09-06-2019 09:31 AM
Hi,
i have a SequenceCall in a TestStand script and i want to get access to all parameters which are located within this call via TestStand API on C#.
Following code gets access to this step, but i would like to know which method can help me for my purpose:
var PropertyObject = MainSequence.GetStep(i, StepGroups.StepGroup_Main).Module.AsPropertyObject(); //with i=iteration of for-loop
PropertyObject.... (?)
Thank you in advance!
Best regards
09-09-2019 09:47 AM
var ActualArgs = PropertyObject.GetPropertyObject("ActualArgs", 0) //will return the argument list object https://zone.ni.com/reference/en-XX/help/370052AA-01/tsapiref/reftopics/sequencecallparameter_argume...
ActualArgs is then a property object that will be filled with each parameter object. So if you want the first one you use ActualArgs.GetNthSubProperty("", 0, 0). This will return the first parameter as a property object.
After that you can access using the property object methods. Things like Expr, ParamType, etc...
Hope this helps,
09-10-2019 04:59 AM
Hi,
it helped at first but afterwards i was not sure which lookupString i need to take. Is there any overview where i can find which strings i can search for? I want to have access to "Parameter Name", "Parameter Type" and "Parameter Value".
Thanks in advance!
Best regards
09-10-2019 09:31 AM
I might have misspoke. Here is a better way:
Count = MainSequence.GetStep(i, StepGroups.StepGroup_Main).Module.AsSequenceCallModule.Parameters.Count
Name = MainSequence.GetStep(i, StepGroups.StepGroup_Main).Module.AsSequenceCallModule.Parameters.Item(Index).AsSequenceCallParameter.Name
Type = MainSequence.GetStep(i, StepGroups.StepGroup_Main).Module.AsSequenceCallModule.Parameters.Item(Index).AsSequenceCallParameter.TypeDisplayString //String you can use to case off of (e.g. Number, String)
Value = Evaluate(MainSequence.GetStep(i, StepGroups.StepGroup_Main).Module.AsSequenceCallModule.Parameters.Item(Index).AsSequenceCallParameter.ValueExpr) //might need to use some casing depending on the type
09-11-2019 08:14 AM
There is no "AsSequenceCall" Method after Module possible in C#. I have only the possibility to make "AsPropertyObject" and then i cant continue as you did it with AsSequenceCall.
Best regards
11-11-2019 04:34 AM
Within the Watch View of Teststand i can reproduce your suggestion. Why is this not possible in C#? Is there any workaround for this?
Best regards