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

How Do I Start my Real-Time Application without setting it as a Startup Executable?

Primary Software: LabVIEW Modules>>Real-Time Module
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
My real-time VIs are completed, and now I am preparing to build a real-time executable.  Since real-time targets typically DO NOT have user interface, how do I start my real-time application without choosing "set as startup"?

Solution:
For many applications, real-time (RT) targets will use stand-alone applications  that are selected as startup executables.  By choosing "set as startup", every time the RT controller reboots the application is started. This is because targets could be running industrial controls systems that must persist even through power surges. 

Some applications call for the user to select when to run an RT application (to begin a test scenario, etc.)  There are three common ways of starting applications on RT targets.  The advantages and disadvantages of each are discussed here.
  1. Idle State in a State Machine - A common LabVIEW architecture is the state machine.  A state machine is a way to implement a flow chart in LabVIEW code.  In your RT application you would use a state machine and make the first state an "Idle" state.  The application will still be set as startup but will remain in the idle state until the user sends a command (in the form of a TCP, UDP, or shared variable communication).

    Advantages
    - The executable always loads at startup.  If you store (in a file) which state the program is in, then after a power surge the program can return to that specific state.  The program also starts quickly because it is only waiting for a command.

    Disadvantages - A host-side program is required to send commands.  If you use shared variables, the RT target will need variable client support installed.

  2.  VI Server - VI server can be used to dynamically call a VI remotely on a RT target.  For more information about how to use VI Server refer to the LabVIEW help.  For an example on how to call a VI programmatically using VI server, refer to the LabVIEW example finder and search for VI Server.  The example is called "VI Server.lvproj" and only installs with the LabVIEW Real-Time module.

    Advantages -  A startup executable is not required in this architecture.

    Disadvantages -  When opening a reference to the VI with VI Server, it takes time to load the VI into memory, thus a slower reaction time to start.  A host side program is required to make VI Server commands.  Additional setup is needed to configure VI Server.

  3. Remote Front Panel - Remote front panels allow users to view and control the VI front panels remotely from LabVIEW or from a web browser without any programming.  Essentially the RT target will broadcast the front panel of the VI and if enabled, allow the user to interact with the VI through a web browser (Internet Explorer, Firefox, etc.)  Instruction on how to enable and configure a remote front panel for a RT target can be found here.

    Advantages - A host side program is not needed to start the VI.  The VI is still built into an startup executable, but typically a button on the RT VI begins the test program.  With the purchase of more remote front panel licenses, more than one user can view the remote front panel.  Be sure to activate your remote front panel licenses for Real-Time.

    Disadvantages - Because RT targets are meant to be headless, no programmatic information about the front panel is stored on the controller.  Thus it is not advised to manipulate the front panel with property and method nodes.


Related Links:
Developer Zone Tutorial:  Application Design Patterns: State Machines
LabVIEW 8.5 Help: Building VI Server Applications
KnowledgeBase 2GD9NCZ8: How Can I View Remote LabVIEW Real-Time Front Panels in a Web Browser?
KnowledgeBase 2UD9C67V: Multi-User Remote Panel Licenses for LabVIEW Real-Time Targets

Attachments:





Report Date: 12/27/2007
Last Updated: 06/08/2009
Document ID: 4GQAE4JV

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