NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Parameters from SequenceCall in C# with Teststand API

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

0 Kudos
Message 1 of 6
(2,199 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(2,127 Views)

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

 

 

0 Kudos
Message 3 of 6
(2,116 Views)

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

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 6
(2,105 Views)

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

0 Kudos
Message 5 of 6
(2,094 Views)

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

 

0 Kudos
Message 6 of 6
(1,935 Views)