The Build Source Files and Execute feature supports executing source-only VIs in TestStand using the LabVIEW adapter when it is configured to use the LabVIEW runtime engine.

The following options and software are required to use the Build Source Files and Execute feature:

  • LabVIEW Development System version 2023 Q3 or higher of the same bitness as TestStand must be installed on the machine and must be the active LabVIEW version. Keep the following in mind to ensure that a compatible version of LabVIEW is set as and stays the active LabVIEW version when using the Build Source Files and Execute feature:
    • The active LabVIEW version on a machine is the latest version of LabVIEW that was launched on that machine. If a version of LabVIEW Development System is already running, launching a different version does not make the second version the active version. You can make a version of LabVIEW supported by the Build Source Files and Execute option active by closing any open LabVIEW instances and launching the supported version of LabVIEW with the same bitness as TestStand.
    • If a supported version of LabVIEW Development System is not installed or active when TestStand is launched, the Build Source Files and Execute option is disabled. You must make a supported version of LabVIEW Development System active and restart TestStand to enable the feature.
    • Sequence files throw errors on execution if the active LabVIEW version changes to an unsupported version while the Build Source Files and Execute option is enabled. To resolve these errors, make a supported version of LabVIEW Development System active and restart your sequence file execution.
    Note When using the Build Source Files and Execute feature with LabVIEW 2024 Q3 or later, follow these steps before executing the sequence file:
    • Disable the Maintain the Save Version of Loaded Projects by Default feature in LabVIEW. This option can be found in the Tools tab in LabVIEW under Tools » Options » Environment.
    • If you mass-compiled your LabVIEW files before disabling Maintain the Save Version of Loaded Projects by Default, set the save version of your LabVIEW projects to Editor Version in the project properties.
  • The TestStand Tools package must be installed on the machine.
    Note This package is installed by default when installing TestStand but is an optional component of the installation.
  • The Enable Version Independent Runtime Engine option must be enabled in the LabVIEW Adapter Configuration.
    Note Enabling the Build Source Files and Execute option in the LabVIEW Adapter Configuration dialog box will also enable the Enable Version Independent Runtime option. The Enable Version Independent Runtime option cannot be disabled while the Build Source Files and Execute option is enabled.
Note You must restart TestStand for changes related to the Build Source Files and Execute option to take effect.

The LabVIEW runtime engine can only load VIs if compiled code created in a LabVIEW version matching the version of the runtime engine is available. Source-only VIs cannot normally be loaded using the LabVIEW runtime engine, as compiled code for these VIs is only present in LabVIEW's compiled object cache if the VI:

  • is opened in the LabVIEW Development Environment and compiled or run, or
  • is modified and saved.
The Build Source Files and Execute feature helps avoid this issue when executing source-only VIs using the LabVIEW runtime engine by determining the LabVIEW modules required for execution and building the LabVIEW source files into one or more Packed Project Libraries (PPLs) before execution begins.
Note
  • LabVIEW steps which call Express VIs are excluded from the PPL builds.
  • LabVIEW modules present in step type sub-steps are not included in PPLs built using the Build Source Files and Execute feature. Custom step type authors should ensure that the LabVIEW modules called from sub-steps of a custom step type have compiled code present to allow execution in the LabVIEW runtime engine.

When using the Build Source Files and Execute feature the LabVIEW modules will load and execute the VIs present in the constructed PPLs during execution instead of the VIs specified in the LabVIEW steps. Since VIs present in PPLs are compiled, they can execute in the LabVIEW runtime engine without issues. Executing the VIs in the built PPLs lets you use the functionality of source-only VIs without requiring compiled code for the VIs to be available.

The Build Source Files and Execute feature builds the LabVIEW source files into PPLs when either:

  • You execute the sequence files calling the LabVIEW files for the first time, or
  • You make changes to the LabVIEW files being called or the LabVIEW steps calling the files.

TestStand only rebuilds the generated PPLs if at least one LabVIEW module from the sequence file gets loaded before execution. If all the LabVIEW modules from the file are already loaded, any changes made to the source files after that will not be present in the PPLs when running your TestStand sequence.

Edit time features like Edit VI, Create Project and Configure Express VI that are only available when the LabVIEW Adapter is set to LabVIEW Development System are enabled when Build Source Files and Execute feature is enabled.
Note Only one TestStand process can use the Build Source Files and Execute feature at a time. The Build Source Files and Execute feature is disabled for TestStand processes launched while an instance using the feature is already open and remains disabled even after the TestStand process using the feature is closed.

Optimizing PPL Build Times

You can improve PPL build times for source-only VIs by making your LabVIEW files source-only when possible. The compiled code for source-only VIs is stored in LabVIEW's cache and can be used to optimize PPL build times.

To set a VI to source-only, press Ctrl+I to open VI Properties and enable Separate Compiled Code from Source File.

Build Source Files and Execute Constraints

The following features and options are not supported when using the Build Source Files and Execute feature:

  • The Switching Between VIs and Packed Project Libraries feature is disabled when the Build Source Files and Execute feature is enabled. If your sequence file is already configured to switch between VIs and PPLs, you can use the Switching Between VIs and Packed Project Libraries feature to use PPL build specifications from your LabVIEW projects instead of a default build specification generated by TestStand.
  • The Preload on File Open load option does not apply to LabVIEW and Sequence Call steps when using the Build Source Files and Execute feature. Steps with this option enabled behave like the load option is set to Preload Before Execution.
  • The Load Dynamically load option does not function for Sequence Call steps when using the Build Source Files and Execute feature. Steps with this option selected preloads their modules before execution begins.

Forcing PPL Rebuilds

If you encounter build errors when building LabVIEW source file PPLs in TestStand or want to force a rebuild of existing PPLs, you can clear the Builder cache by selecting Execute → Clear LabVIEW Builder Cache from the main TestStand window.

Clearing the Builder cache for a sequence file clears the data stored for built PPLs related to that sequence file, forcing the next execution of the sequence file to rebuild PPLs for any LabVIEW VIs called from that file. You can clear the Builder cache for the active sequence file or for all files using previously built PPLs.

Note  You can use the Clear LabVIEW Builder Cache option to remove any VIs deleted from or skipped in a sequence file from the list of LabVIEW files used in future PPL builds.

Support for Debugging

To debug PPLs built using the Build Source Files and Execute option:

  1. Enable the Enable Debugging and Tracing option to make PPLs built using the Build Source Files and Execute feagure debuggable.
    Note  Changes made to this option do not take effect until you restart the TestStand application.
  2. Open the source VI you would like to debug, place breakpoints where necessary and save the changes. When the PPL containing the modified VI is built, the corresponding VI in the PPL will also have breakpoints.
  3. Execute the sequence you want to debug once to build the PPLs and load VIs into memory in the LabVIEW runtime Engine.
  4. Set LabVIEW to use the TestStand executable to debug.
    1. Open the Debug Application or Shared Library window in LabVIEW by navigating to Operate → Debug Application or Shared Library.
    2. Attach LabVIEW to TestStand by selecting the following in the Application or Shared Library drop-down menu:
  • SeqEdit.exe - ‹ProjectName›.lvproj - My Computer to debug VIs called in project context.
  • SeqEdit.exe to debug VIs called in the default Application context.
  • Execute your sequence in TestStand. If there are breakpoints present in a called VI, they will be hit and will break execution to allow for debugging. If there are breakpoints present in called LabVIEW steps, they will also break execution and allow you to step into called VIs to debug using the LabVIEW Development System.
Note  Sequences must be run at least once before they can be debugged remotely from the LabVIEW Development System, as the VIs called by the sequence need to be loaded into memory.