NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Store object reference in variable resolved by other variable

Hi everyone,

 

In my test setup I use a Thread and I want to store an object ref to that Thread in a variable (type: object reference).

In the sequence call settings I can provide a variable where I want to store this.

 

I've done this before and it all worked fine. When I stop the thread I'm able to use a wait step that waits for the thead to stop by providing the reference I stored when the thread was started.

 

Now I want to store the reference in a variable that is based on another variable. In my situation the following construction works. This is way I've entered in the Sequence call settings:

 

#NoValidation = True, Evaluate("FileGlobals.ModuleConfig." + Parameters.ModuleInstance + ".ThreadRef")

 

As you can see Parameters.ModuleInstance determines in which container the thread ref should be stored. But since this parameter is empty by default the evaluation fails so I have to use #NoValidation.

This seems a bit ugly to me so I also tried:

 

FileGlobals.ModuleConfig.GetPropertyObject(Parameters.ModuleInstance + ".ThreadRef")

 

According to teststand this construction is OK, however my thread ref is not stored in this case...

 

Is the first option I mentioned the only possible way for my problem? Or are there other, more elegant ways?

0 Kudos
Message 1 of 2
(3,722 Views)

Hi Kayr,

 

I agree that the second approach you mention is the more elegant way to accomplish this.  I was able to successfully use this method on my end to access a propertyObject.  Can you send a sample sequence file so I can take a look?

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 2
(3,683 Views)