NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

what should be specified in object reference field in the first step of sequence file in test stand

Test stand object Reference field- <The expression cannot be empty>

 

It is showing an error like "The .Net property can not be accessible

                                         Object Reference not set to an instance of an object".   

 

How it can be resolved?

                                                     

0 Kudos
Message 1 of 11
(5,185 Views)

If this is the first step in your sequence to interact with the .NET assembly, you have to make sure that the object you want to interact with can be created from an external process (in this case TestStand). Then you have to check the checkbox "Create Object".

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 11
(5,184 Views)
I am creating the sequence file in teststand dynamically using c#.Net. if i am supposed to check the checkbox of create object.How can I do that dynamically through c#
0 Kudos
Message 3 of 11
(5,180 Views)

I am not sure about this because i never used another tool than UIs in order to create sequences containing .NET steps (so manually selecting all the stuff).

But looking into the help of TestStand Adapters, you can find the CreateObject property from the DotNetModule-class:

CreateObject Property
Syntax
DotNetModule.CreateObject

Data Type
Boolean

Purpose
Specifies whether to create a new instance of the class.

 

I think this is worth a try....

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 11
(5,176 Views)

Hi bannerghatta !

 

Have you ever open and looked into the zip file

from my previous post ?!?

http://forums.ni.com/ni/board/message?board.id=330&thread.id=26979&view=by_date_ascending&page=2

 

There you can see how the constructor activating is done.

Well my stuff is done in Teststand it self.

If like do this in C#, you only need to copy the calls into your IDE, thats all.

 

Hope this Helps

 

Juergen

 

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 11
(5,173 Views)

I am using Singleton Class in .Net. So I need not create object in TestStand. The Get property of the class will return its own class object. So the Class Reference should be empty only.

When I choose the property manually, I am getting this error. This I am getting only when I create this step through C# TestStand APIs. Please help me to remove this error in the Class Reference field using TestStand APIs.

0 Kudos
Message 6 of 11
(5,167 Views)

..And how do you get a refenerce to you class. You like to get/set some properties but from which object ?

where is handle to this class?

 

What about providing a small TS/VS example

Instead of keeping it in "whiteness"  ?

 

I am sure the "blue ones" or some other members will find an answer/solution to your requirement

 

 Juergen

 

Message Edited by j_dodek on 01-28-2010 01:35 PM
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 7 of 11
(5,151 Views)

If you specify a static member, the Object Reference field should not show as being required any more.  In your post you said "The Get property of the class will return its own class object".  This makes it sound like you have a non-static property that literally has "return this;" in it.  This obviously will not work because if you can call a non-static member then you must already have the class object.  What you need in your singleton is something like this:

 

private static MyClass sMyClassInstance;
public static MyClass GetMyClassInstance()
{
if (sMyClassInstance == null)
sMyClassInstance = new MyClass();
return sMyClassInstance;
}

 

Is this how you have it setup?

 

-Jeff

0 Kudos
Message 8 of 11
(5,138 Views)
I am using static property only to return its own class object.  Even then, I am getting this problem.
0 Kudos
Message 9 of 11
(5,106 Views)

So you are saying that once you specify a static member you still see the object reference as saying "<The expression cannot be empty>"?  Can you reproduce this in a simple case and attach the source code?  Otherwise there's not much I can do...

 

-Jeff

0 Kudos
Message 10 of 11
(5,022 Views)