Building and Deploying a Stand-Alone Real-Time Application
- Updated2025-02-17
- 5 minute(s) read
Complete the following steps to build a stand-alone real-time application and deploy it to an RT target:
Note
- Before deploying the application, determine which method of deployment best suits your application needs.
- If you update any of the Startup VIs or Always Included files after you build the application, you should rebuild the application instead of attempting to copy the files directly to the RT target.
- Open the project you want to use to build the stand-alone real-time application.
- Right-click Build Specifications under the RT target and select New»Real-Time Application from the shortcut menu to display the Real-Time Application Properties dialog box.
- Complete the following items on the Information page of the Real-Time
Application Properties dialog box:
- Enter a name for the build specification in the Build specification name text box. This name appears under Build Specifications. The name must be unique among other build specification names under the RT target.
- Enter a name for the stand-alone real-time application in the Target filename text box. Stand-alone real-time applications must have a .rtexe extension.
- Explore the remaining items on the Application Information page.
- Complete the following items on the Source
Files page:
- In the Project Files tree, select the VI you want to define as a startup VI, also known as a top-level VI, for the stand-alone real-time application. Startup VIs open and run when you power on the RT target. You must define at least one VI as a startup VI for each stand-alone real-time application you build.
- Click the right arrow button next to the Startup VIs listbox to move the selected VIs into the Startup VIs listbox.
- In the Project Files tree, select the items you want to define as dynamically called VIs or support files, such as VIs you want to call using the VI Server or text files that you read from a VI.
- Click the right arrow button next to the Always Included listbox to move the selected items into the Always Included listbox.
Note You cannot include a polymorphic VI in the Startup
VIs or Always Included listboxes. Use an
instance of the polymorphic VI instead.
- On the Destinations page, configure destination settings and add destination directories for the stand-alone real-time application.
- From the Source File Settings page, edit destinations and properties for
individual files and folders in the stand-alone real-time application.Note If you plan to distribute a stand-alone application that uses shared variables, do not include the .lvlib file in an LLB or in the executable. Change the Destination of the .lvlib file to a destination outside the executable or LLB.
- On the Advanced page, configure advanced settings for the stand-alone real-time application.
- On the Additional Exclusions page, configure settings to reduce the size of the stand-alone real-time application, improve load time, and reduce memory usage when you load the resulting build.
- On the Pre/Post Build Actions page, specify VIs for LabVIEW to execute before or after the build.
- On the Preview page, click the Generate
Preview button to review the generated files for the stand-alone
real-time application.Note Save changes to VIs in memory before you create or edit a build specification to ensure that the preview is accurate.
- Deploy the application from the Project Explorer window or outside of the
LabVIEW development environment.Note If you make modifications to your code and want to redeploy your application, right-click the build specification and select Undeploy from the shortcut menu to remove files from earlier deployments. This operation removes all files previously deployed to the target, not just the files deployed by the individual build specification. To avoid conflicts, use this option to remove deployed files from a target before using a different system to transfer files, such as installation through SystemLink.
Deploying from the Project Explorer Window
Complete the following steps to build a stand-alone application and deploy that application to an RT target from the Project Explorer window:
- Use the Real-Time Application Properties dialog box to specify settings for the application.
- Click the Build button. The build specification name appears in the project in the Build Specifications tree under the RT target in the Project Explorer window, and LabVIEW places the application in the directory you specified on the Destinations page of the Real-Time Application Properties dialog box.
- Right-click the build specification and select Set as
startup from the shortcut menu. Note You can create multiple build specifications that configure the settings of stand-alone real-time applications under an RT target. However, you can set only one stand-alone real-time application as startup for an RT target. When you set a build specification as the startup application for an RT target, LabVIEW displays a green border around the icon for the build specification in the Project Explorer window.
- Right-click the build specification and select Deploy from the shortcut menu to deploy the application to the RT target.
- Right-click the RT target and select Utilities»Restart to reboot the RT target and run the stand-alone real-time application.
Note You cannot run a stand-alone real-time application without setting
the application as startup and rebooting the RT target.
Deploying from outside of the LabVIEW Development Environment
Complete the following steps to deploy a stand-alone real-time application from outside of the LabVIEW development environment:
- Use the Real-Time Application Properties dialog box to specify settings for the application. Note You must specify at least one startup VI from the Source Files page.
- On the Component Definition page, place a checkmark in the Create a component definition file (.cdf) and specify dependencies checkbox.
- (Optional) If you want to specify a version number for the application, remove the checkmark from the Auto increment checkbox in the Version Number panel and specify a version number for the application.
- (PXI) In the Required software components list, place a
checkmark in the checkbox next to each software component that you need to
install alongside the application. Choose between the available versions of each
software component with the Software version pull-down
menu. (CompactRIO) Select the software set you need to install alongside the
application in the Required software set list. In the
Addons list, place a checkmark in the checkbox next
to each addon you want to install. (Optional) Remove the checkmark from the
Show software by set checkbox to view a list of
available software components instead. Note LabVIEW always specifies the version of the LabVIEW Real-Time Module that you are running as a dependency of the application.
- Click the Build button. LabVIEW builds the application and a component definition file (.cdf), which defines the application and its dependencies. LabVIEW places the .cdf in the National Instruments\RT Images\User Components directory.
- When the build completes, review the location of the built application in the Build status dialog box and click the Done button.
- Install the application and its dependencies to a small number of targets using NI Measurement & Automation Explorer (MAX) or a large number of targets using the Install Startup instance of the Install VI. Refer to the Installing a Startup Application topic in the Measurement & Automation Explorer Help for steps to install a stand-alone application using MAX.
For more information about deploying stand-alone real-time applications from outside the LabVIEW development environment, refer to Using Application Components to Deploy LabVIEW Real-Time Applications, available on ni.com.