NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

GetTypeDisplayString: Obsolete!

Solved!
Go to solution

Unfortunately this morning I disovered that the GetTypeDisplayString method is obsolete. The solution proposed "Use the PropertyObjectType.DisplayString property instead" does not fix my issue.

I used this method to get the type of the locals variable using the lookup string in input. The solution proposed does not have any lookup string as input.

 

How can I get the same results with the new method?

 

Thanks a lot.

 

 

0 Kudos
Message 1 of 7
(4,014 Views)

Hi,

 

Instead of using your ProperyObect reference used to get your GetTypeDisplayString, use it to get the Type reference (PropertyObject.Type) to return a PropertyObjectType reference, then you can use this reference to get the DisplayString.

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 7
(4,009 Views)

This the solution proposed by NI but I can not do in this way. I had the reference of all the locals variables  that belong to a sequence (see attachment). How can I point to a variable rather than another without the lookup string?

 

Thanks.

 

 

 

 

0 Kudos
Message 3 of 7
(4,006 Views)

Hi,

 

What's returned from the Get Variable VI, is that an array of objects? If it is then you loop through the array using one of the PorpertyObject Index methods.

 

If you dont know the actual name but are going by what you found under Locals in a Sequence, then you use the index to return a PorpertyObject to that actual variable. Once you have a reference to the actual variable then you can use that reference to obtain your type string.

 

eg

Locals.

   variable_1 .......index 0

   variable_2 .......index 1     etc

 

 

if you are still having problems, I'll send you an example later on today when I have access to TestStand

 

 

 

 

 

Regards
Ray Farmer
0 Kudos
Message 4 of 7
(3,998 Views)

Hi Ray, I was not able to make it work, but this is the right way.

 

If you could send me an example I will appreciate very much.

 

Thanks.

0 Kudos
Message 5 of 7
(3,976 Views)
Solution
Accepted by logatto

If you need to use a lookup string do the following:

 

myVar.GetPropertyObject("MyLookupstring", 0).Type.DisplayString

 

 

Hope this helps,

-Doug

0 Kudos
Message 6 of 7
(3,972 Views)

Thanks Dug, it works.

 

I always lose in TS API. Can you suggest me some documents to deepen this topic?

 

 

0 Kudos
Message 7 of 7
(3,967 Views)