Error -17308 When Reading TestStand Enum via API

Updated Sep 26, 2025

Reported In

Software

  • TestStand
  • LabVIEW

Operating System

  • Windows

Issue Details

  • I try to read a TestStand enum variable via e.g. GetValNumber but I receive the following error or similiar:
    Error -17308 occurred at Expected type Number. Found type [...] in [...]
    -17308; Specified value does not have the expected type.
    Error in call to TestStand API member 'PropertyObject.GetValNumber'.
    Expected type Number.  Found type Enum.
  • I'm trying to retrieve an enum variable from LabVIEW using TestStand's API an get Error -17308:



    How can I read an enum value using the TestStand API?

Solution

This error usually happens because the TestStand API does not have a direct way to read or write enum values directly. In order to retrieve or set values of Enum types correctly, make sure to set the options parameter to PropOption_Coerce.You can address this issue depending on the developing environment you are using:

 

Reading Enum Variable in TestStand

To read an enum variable via e.g. GetValNumber you need to set the options parameter to PropOption_Coerce. For example:

FileGlobals.GetValNumber("MyEnum",PropOption_Coerce)

This statement reads a Enum in FileGlobal named "MyEnum" as a Number.

 

Reading Enum Variable in LabVIEW with TestStand API

If the error appears when using the TestStand API in LabVIEW, make sure you are retrieving the enum type as a PropertyObject, otherwise the operation will still give the error presented above. For example, to retrieve the number value of the enum you need to:

  1. First use the Get Property Object.vi in order to get the PropertyObject of the enum.
  2. Then use the GetValNumber method to read the value stored in the enum variable. As shown in the code below:

Note: Remember to set the options value to PropOption_Coerce which would be 197112 or 0x301F8 in hex.

This will read the Enum in FileGlobal named "MyEnum" as a Number.

Additional Information

Make sure to check the TestStand Enumerations Reference Guide for all the supported methods that can be applied to enum variables.