NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a .NET adapter step using Teststand API

Hello guys, I'm struggling with the teststand API to create a .seq using code, maybe someone could help.

Currently, I'm creating new steps using .NET adapter and setting its properties using AsPropertyObject().SetValString, as the example below:

 

step.AsPropertyObject().SetValString("TS.SData.AssemblyPath", 0, "BenchAbstractionLayer.dll");

 

But as you can see from fig1 below, there is a property .NET Invocation, which happens to be stored in Step.TS.SData.Calls, that I couldn't figure out how to set using the teststand API.

 

moduledotnet1.png

 

I noticed that if I create a new element in the Step.TS.SData.Calls using the teststand GUI, it will automatically come in the .NET structure, as shown in figs:

creating new element using GUIcreating new element using GUInew element creatednew element createdempty Calls after creating stepempty Calls after creating step

 

So I guess I need to insert a new element in the same way it is done in the GUI, but using the teststand API. Is there any way to do that?

 

Some attempts I tried but did not work were:

 

step.AsPropertyObject().SetValString("TS.SData.Calls.0.ClassName", 1, "Data_Here"); - doesn't work because it will not find the element called "0".

 step.AsPropertyObject().NewSubProperty("TS.SData.Calls.0", PropertyValueTypes.PropValType_Container, false, "", 0); - doesnt work because You cannot create a subproperty in an item that is not a container

 

Any other ideas?

0 Kudos
Message 1 of 1
(1,528 Views)