Configuring Startup VIs on LabVIEW Real-Time Targets Without Application Builder

Updated Jan 29, 2018

Reported In

Software

  • LabVIEW Real-Time Module
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

How do I configure a VI to start when my LabVIEW Real-Time target boots if I do not have Application Builder to create a startup executable?

Solution

The recommended way to create an application is to build a startup executable. For more information on why this is the recommended way please see LabVIEW Real-Time Startup VI vs Executable.

In LabVIEW Real-Time 8.0 and later, it is possible to configure a VI to start when the real-time (RT) target boots using the following steps:
  1. Create a Source Distribution with your VI. This ensures that all of the dependencies of the VI will be included so that it can be transferred to the hard drive of the RT target. Be sure to clear the check marks from the options to exclude VIs from vi.lib, instr.lib, and user.lib. 
The steps to create a Source Distribution that contains the Startup VI are as follows:
  1. In the Project Explorer windows right-click on Build Specifications and select New»Source Distribution.
  2. In the Source Distribution Properties window take note of Destination directory. This is where your file will be once you have built your Source Distribution.
  3. In the Source Files category of the Source Distribution Properties window include the VI and dependencies that are required.
  4. In the Destinations category ensure that the Destination type is select as Directory. Depending on how your dependencies and VIs are referenced you may need to select Preserve hierarchy. With that selected, the folder structure of your project will be recreated.
  5. In the Additional Exclusions category, ensure that the Exclude files from vi.lib, Exclude files from instr.lib,and Exclude files from user.lib are unchecked. Also, ensure that Remove Unused Polymorphic VI Instances and Remove Unused Members of Project Libraries is enabled.
  6. Once the above steps have been completed left-click on the Build button to build the Source Distribution.
  1. Depending on which version of LabVIEW you are using, you can use either the LabVIEW project, FTP, or WebDAV system to transfer the source distribution output to the hard drive of the RT target. 
  1. In the LabVIEW project, simply right click on your source distribution and select Deploy.
  2. More information on how to FTP is available in Transfer Files Using FTP Between Host and Real-Time Targets in NI MAX
  3. More information on how to use WebDAV is available in: Using WebDAV to Transfer Files to Your Real-Time Target
  1. Configure the RTTarget.StartupVIs token to point to the source distribution.

VxWorks(All Versions), PharLap ETS(All Versions), NI Linux RT (2014 and previous)

Add the RTTarget.StartupVIs token under the [lvrt] section of the ni-rt.ini file. If it has not been previously set, the token may not appear in the ini file. For VxWorks and PharLap, the token accepts a string of VI paths separated by semicolons and multiple VIs may be set to start. 
 
Example for LinuxRT OS: RTTarget.StartupVIs=/home/lvuser/natinst/bin/foo.vi
Example for PharLap OS: RTTarget.StartupVIs=c:\ni-rt\startup\foo.vi
Example for VxWorks OS: RTTarget.StartupVIs=/c/ni-rt/startup/foo.vi

NI Linux RT (2015 and newer)

Add the RTTarget.StartupVIs token under the [lvrt] section of the lvrt.conf file located at /etc/natinst/share/lvrt.conf. If it has not been previously set, the token may not appear in the configuration file. 

Example for LinuxRT OS: RTTarget.StartupVIs=/home/lvuser/natinst/bin/foo.vi
  1. Reboot the target in order for the startup VI to be executed.

Additional Information

  • Enabling a startup application (.rtexe) will override any startup VIs and only the executable will be run. The startup VIs will not attempt to run.
  • Similar to a startup executable, the LabVIEW development environment cannot connect to a system running a startup VI without stopping the VI.
  • It is not possible to remotely debug Startup VIs in the LabVIEW development environment, it is however possible to debug startup executables.

WAS THIS ARTICLE HELPFUL?

Not Helpful