NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling .NET functions with .NET collections

Solved!
Go to solution

I have a .NET library with a function that takes in a List collection type as a parameter. Currently, I am using an action step with that .NET library as the assembly. Then I scroll down to the "Reference Generic Types" section to select System.Collections.Generic.List and creating an object reference to this list. I then use that object reference in the function call that takes the List type parameter.

 

Is there a simpler way to do this that would avoid this 2-step process without modifying the .NET library?

0 Kudos
Message 1 of 3
(2,844 Views)
Solution
Accepted by topic author cjohnson963

I see this is basically a follow up to your other post here: https://forums.ni.com/t5/NI-TestStand/Pass-NET-Class-Variables-to-a-Function/m-p/3990300#M60949

 

Unfortunately if you have a method that takes a .NET class object as a parameter (and assuming it does not accept null), you have to create the .NET object to pass in as a parameter in a separate step. It has nothing to do with the object being a collection or a generic though, the same would be true if it was a simple class object.

0 Kudos
Message 2 of 3
(2,773 Views)

Yeah, it's kind of a follow up to that other question. I end up with 3-steps to do something fairly simple.

 

Well I kind of suspected that would be the case. Thanks for confirming that.

0 Kudos
Message 3 of 3
(2,771 Views)