09-13-2010 04:51 AM
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.
Solved! Go to Solution.
09-13-2010 05:58 AM
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.
09-13-2010 06:30 AM
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.
09-13-2010 07:13 AM
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
09-13-2010 09:28 AM
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.
09-13-2010 09:46 AM
If you need to use a lookup string do the following:
myVar.GetPropertyObject("MyLookupstring", 0).Type.DisplayString
Hope this helps,
-Doug
09-13-2010 10:22 AM
Thanks Dug, it works.
I always lose in TS API. Can you suggest me some documents to deepen this topic?