NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TS 3.5 .net dll is giving object reference error

I am trying to run a .net action in TS 3.5. I receive "object reference not set to an instance of an object error"

Actually this is the first time i have to call a .net dll so i need some instruction.

I am not very sure if the error is due to my source code. Is there anything that i need to to take care while preparing my dll to run it from TS 3.5. I wrote the dll with C# btw.

0 Kudos
Message 1 of 5
(3,331 Views)

You should try debugging the process with visual studio and a debug build of your assembly to see where the unset reference is being used (likely in your code). Do you have any specific questions about how to specify a call into an assembly?

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 5
(3,328 Views)

But my main problem is to clear out what the TS error message means? Is there any tutorial about calling .net dlls from Teststand

0 Kudos
Message 3 of 5
(3,326 Views)

That's not a teststand error, that's a .NET exception. That means you have a .NET reference that is set to null, yet you are trying to make a call or access data on it.

 

There are example sequences such as <TestStandPublic>\Examples\Demo\dotnet

 

There is also a help file for the panel where you fill in the settings.

-Doug

0 Kudos
Message 4 of 5
(3,315 Views)

You will also likely get this error if you are trying to call an instance member without first creating the class.  You need to configure a constructor if your method is not static.  You can then store the object reference in a variable and then use it in subsequent steps.

 

If you are already doing this, or your methods are static, then the exception must be coming from inside your code module as Doug has suggested.

 

-Jeff

0 Kudos
Message 5 of 5
(3,312 Views)