NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access to container ActualArgs in TS.SData

Hi,

I want to get the parameter names of a sequence call step by using the TestStand API. The Container with this data is called ActualArgs, but how can i get the names (normaly arg0...argx) of all used parameters?

Regards,
Sunny
0 Kudos
Message 1 of 5
(4,096 Views)
Sunny -
In TestStand 2.x you cannot access this information. The names only showed up as arg0 etc, as you have described.

In TestStand 3.0/3.1, the arg0 subproperty names are actually now the names of the parameters. In addition you can use the extended Adapter API to access all the parameter information using properties of the class instead of using the property object interface.

Scott Richardson (NI)
Scott Richardson
https://testeract.com
Message 2 of 5
(4,096 Views)
Hi Richard,

Sorry for my late response, but i couldn't try your suggestion until now. I use the TestStand API with Visual Basic 6 and i have some problems with the non existing Inheritance functionality in it.

Do you have any example using the extended Adapter API with Visual Basic?

Regards,
Sunny
0 Kudos
Message 3 of 5
(4,096 Views)
Sunny -
I thought that the SequenceCallParameter class exposed the parameter name, but it does not. It should and I will see if I can add that in the future.

The simple way would be to use the PropertyObject class as shown below:

Scott Richardson (NI)

Public Sub AccessStepInfo(oContext As TS.SequenceContext)
Dim oStep As TS.Step
Dim oActualArgs As TS.PropertyObject
Dim iItems As Integer
Dim i As Integer
Dim sString As String

Set oStep = oContext.Sequence.GetStepByName("SequenceCall", StepGroup_Main)
Set oActualArgs = oStep.AsPropertyObject().GetPropertyObject("TS.SData.ActualArgs", 0)

iItems = oActualArgs.GetNumSubProperties("")
For i = 0 To iItems - 1
sString = sString & o
ActualArgs.GetNthSubPropertyName("", i, 0) & vbCr
Next i
MsgBox sString
End Sub
Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 5
(4,096 Views)
Hi Richard,

Your suggestion is great, now i'm able to get the
parameter names and their values!

Regards
Sunny
0 Kudos
Message 5 of 5
(4,096 Views)