Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
14 ratings:
 3.92 out of 5     Rate this Document

Configuring Startup VIs on LabVIEW Real-Time Targets with a Source Distribution

Hardware: PXI/CompactPCI>>Controllers

Problem:
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 KnowledgeBase 4L89M48A: Startup VIs vs Startup Executables on a Real-Time Operating System.

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.
    6. Once the above steps have been completed left-click on the Build button to build the Source Distribution.

  2. Using FTP, transfer the source distribution output to the hard drive of the RT target. More information on how to FTP is available in KnowledgeBase 3UJACBE9: FTP Transfer of Files Between Host and Real-Time Target in MAX.

  3. Configure the RTTarget.StartupVIs token in the [lvrt] section of the ni-rt.ini file. The ni-rt.ini file is found in the root of the RT target (c:\). If it has not been previously set, the token may not appear in the ini file. The token accepts a string of VI paths separated by semicolons and multiple VIs may be set to start. A simple VI is provided below which can be run on the RT target to interactively modify this token in the ni-rt.ini file on target.

    Example for PharLap OS: RTTarget.StartupVIs=c:\ni-rt\startup\foo.vi
    Example for VxWorks OS: RTTarget.StartupVIs=/c/ni-rt/startup/foo.vi

  4. Reboot the target in order for the startup VI to be executed.
Notes:
  • 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.


Related Links:
KnowledgeBase 4L89M48A: Startup VIs vs Startup Executables on a Real-Time Operating System
KnowledgeBase 3UJACBE9: FTP Transfer of Files Between Host and Real-Time Target in MAX
KnowledgeBase  4LRA4IQ0: What Operating System is my Real-Time Controller Running and Why?

Attachments:


Configure RT StartupVIs.vi


Report Date: 01/16/2006
Last Updated: 04/03/2009
Document ID: 3TFFQLQS

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit