Error 1057 When Using XControl in LabVIEW™ Packed Project Library

Updated Jul 1, 2026

Reported In

Software

  • LabVIEW
  • LabVIEW Application Builder Module

Issue Details

I am casting a Front Panel Control to an XControl using the To More Specifc Class primitive in LabVIEW. When I build my code into a Packed Project Library (PPL) and run it from the PPL, the code returns the following error at run time:

Error 1057 occurred at To More Specific Class at an unidentified location

Possible reason(s):

LabVIEW: (Hex 0x421) Type mismatch: Object cannot be cast to the specified type.

 

 

This behavior only occurs when running the application from the PPL. The code appears to execute without error in the development environment.

Solution

To prevent this error, include the XControl in the Support Directory of the Packed Project Library (PPL) build specification. Follow these steps:

 

  1. In your LabVIEW project, create a new Packed Project Library build specification.
    1. Right-click Build Specifications and select New>>Packed Library.
  2. Select the Destinations category.
  3. Configure the Support Directory.
    1. Set a Destination path for the Support Directory. The default location can be used.

 

 

  1. Select the Source File Settings category.
  2. Locate the XControl in the Project Files tree.
    1. Ensure the XControl is included in the project and not part of the top-level library being built.
  3. Assign the XControl to the Support Directory.
    1. Select the XControl.
    2. Set the Destination to Support Directory from the drop-down menu.

 

 

  1. Complete the remaining build configuration as needed and build the PPL.

Additional Information

The XControl must not be included in the top-level library that is built into the PPL. Instead, it should be assigned to the Support Directory during the build configuration. Including the XControl in Always Included is not required for this scenario.

Error 1057 is a general LabVIEW error indicating a type mismatch. Although it is observed here with an XControl, this error can also occur when casting between other class types.