In order to programmatically launch a VI on an RT target, you must make your project into a source distribution and deploy the source distribution to your target.
Creating and Deploying Source Distribution
1. In the project containing your VI (RT_Main.vi), right-click on Build Specifications and select New»Source Distribution.
2. In the Source Files category, select your VI and press the arrow pointing right to move it into the Always Included box.
3. In the Destinations category, designate where you would like the VI to be placed by modifying the Destination path.
4. Click Build.
5. Right-click on your source distribution and select Deploy.

Remotely Run VI Using VI Server in LabVIEW
Now that there is a source distribution with the VI you want to launch on your target, follow the steps below to launch it from the host computer through VI Server.
1. Place an Open Application Reference function on the block diagram and wire the IP address of the RT Controller to the machine name input.
2. Place an Open VI Reference function on the Block Diagram. Use it to open a reference to the main VI in the RT target. In the case of a top-level VI called RT_Main.vi, the path to open for the default executable location would be home\lvuser\natinst\bin\RT_Main.vi
3. Use an Invoke Node or a Call By Reference Node to run the remote VI. To create an Invoke Node, right-click the vi reference output of the Open VI Reference and click Create»Method for VI Class»Run VI.
4. When you no longer need the VI to run on the Real Time target, close the VI reference, then the LabVIEW application reference. Use the Close Reference VI to achieve this. Note that the dynamically called VI can only run on the RT target while the reference remains open, and that closing the reference will stop the VI on the Real-Time target.

There are some instances when using the path data type does not provide sufficient location information to open the VI reference and will return error -1445. If this occurs, wire a string constant containing the name of the VI to the vi path input of the Open VI Reference function. For this example, a string constant containing the top-level VI name, RT_Main.vi, would be used as an input.
Additional Information
When using VI Server functions, it is important to ensure that VI Server security permissions are set appropriately, or errors may occur. Open the properties of the RT controller (right-click the controller in the LabVIEW project and select Properties) and choose the VI Server section on the left-hand side of the window. Make sure that TCP/IP is checked. Note that the default Port is 3363. If this is not done, you may get an error 63 pop-up when you try to execute your VI.
For source distributions that use VIs from libraries (DAQmx, VISA, etc.), ensure those libraries are included in the distribution (otherwise the VI will not run). To achieve this, you can open the distribution properties window (right-click the distribution package in the LabVIEW project and select Properties) and, in the Additional Exclusions tab, uncheck the options as shown in the picture below. Now, when the VI runs, all the VIs inside the libraries will be available on the Real-Time controller