Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6733

GetValString("", PropOption_CoerceFromEnum) is not working on values retuned from LabVIEW

$
0
0

I checked TestStand 2019 (32-bit)\Examples\Fundamentals\Using TestStand Enumerations\LabVIEW\Using TestStand Enumerations.seq example.

 

I tried to get enum string and value in watch window using Locals.Color.GetValString("", PropOption_CoerceFromEnum) and Locals.Color.GetValNumber("", PropOption_CoerceFromEnum)

 

Only GetValNumber works. Why I can't get enum string this way? According to the documentation I should be able to accomplish this with flag PropOption_CoerceFromEnum (Use this option for implicit conversion when using an enumeration value as a string or number. You can use this option with the PropertyObject.GetValNumber and PropertyObject.GetValString methods).

 

EnumsIssue.png

 

To have GetValString working I need to manualy select enum value in variables pane (so the curly brackets change into square brackets).

 

EDIT:

I was able to get enum string with Locals.MyEnum.Enumerators.GetPropertyObjectByOffset(Locals.MyEnum.GetValNumber("", PropOption_CoerceFromEnum), PropOption_NoOptions).GetValString("", PropOption_CoerceFromEnum) but this will work only if MyEnum values are Enumerators offset indices.


Viewing all articles
Browse latest Browse all 6733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>