NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Typecasting a propertyobject ref to a custom datatype?

I have a reference to a PropertyObject stored in my station globals. I know that this PropertyObject is of a specific datatype which is defined in my custom data types. Is there any way to let TestStand know what the datatype of this propObj is? I imagine that this implementation would have to be similar to the "AsPropertyObject" method that allows you to cast a reference to a property object, and then access propertyobject specific properties and methods... Or am I going to to settle for the StationsGlobals.MyReference.AsPropertyObject.GetValNumber("myLookupString",0) approach to pull this data out? (I'd prefer something that looks like: StationsGlobals.MyReference.AsMyCustomDataType.myNumericValue()...) Thanks!
-Carl
CLA/CTA
0 Kudos
Message 1 of 3
(3,289 Views)
Hi, Carl,

May I ask why you're trying to do this? I'm not aware of a method similar to what you described. You can't insert your customized function into the TestStandAPI. So the AsMyCustomDataType method you want to have will not work. Is there anything you don't like about the generic AsPropertyObject method?
Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 2 of 3
(3,262 Views)
Song, I have a type defined in TestStand, and the reference I'm looking at will store a propobj of this type at runtime. I'd like to directly access the properties within this type using the intellisense rather than typing out the entire string with an API call for a few reasons: A) I can more-easily insert array element variables into it B) I can verify that the string format is correct as I'm building it amongst others... Anyway, I did find out something that'll work for me: If I have a station global reference populated with a ref to the desired property object, I can use the intellisense to access all properties within that propertyobject. Although this does cause TestStand to think that my formula is invalid when the ref isn't populated, I can work with this. Thanks, Carl
-Carl
CLA/CTA
0 Kudos
Message 3 of 3
(3,247 Views)