Using VI Server to Run LabVIEW Real-Time VIs Stored on an RT Series Hard Drive
Downloads
Filename: 203620.zip
Requirements: View
Some LabVIEW Real-Time Module users run programs with a RT target VI that runs in the Real-Time operating system and a host computer VI that runs in Windows. This example shows you how to store the RT target VIs on the permanent storage device of a target (such as the hard drive on a PXI controller or the Flash memory of an FP-20xx). You then can use the VI Server to programmatically call and run the RT target VI from the host computer. The VIs do not consume space in the memory of the RT target while they are not running. Also, there is no need for a startup executable when using this technique. In some cases, this may be more flexible than using a more static startup executable.
This example also shows how to make sure the embedded RT target VI continues to run, regardless of whether the host VI stops or the host PC crashes. To accomplish this, the RT target VI opens a reference to itself. Usually the only reference to the RT target VI is the reference created by the host computer. If the host computer VI stops or the host computer crashes, the reference closes and the remote system memory unloads the RT target VI. However, if the RT target VI opens a reference to itself, the VI can continue to run, regardless of what happens to the host computer.
Note: You also can run this example between two machines running standard (non-RT) LabVIEW.
Instructions:
1. Make sure the remote system is configured to allow remote VI Server access. It is possible to run this example on two non-RT targets, if both computers are running LabVIEW.
2. Before using emb.vi, you need to compile it for your version of LabVIEW. To do this, open and save "emb.vi" in the "emb.llb" library (see the link below) in the version of LabVIEW you are using. You can also update "emb.vi" by mass compiling "emb.llb." If you do not compile the VI, you will see "Error 7 occurred at Open VI Reference in call emb.vi."
3. Use FTP to place emb.llb in the c:\ni-rt\startup\ directory of the RT target. (You do not need to download any VIs to the RT target using the RT Development System). If using non-RT targets, create the directories for this example. It is not necessary that your own code use exactly this directory.
4. Run call emb.vi on the host computer.
Even if call emb.vi stops executing, the embedded VI can continue to execute. To see this, stop call emb.vi. Then, when the dialog box appears with the question, "Would you like to stop and unload emb.vi from memory on the RT Engine?", click No. Restart call emb.vi and notice that emb.vi continued to run after call emb.vi stopped executing. The number of iterations of emb.vi increased while call emb.vi was not running.
Note: When implementing this procedure with your own VIs on the RT target, make sure that the VI library that you transfer to the remote system includes all subVIs, including subVIs from the vi.lib directory. Also, if any DLLs are needed, transfer using FTP those DLLs to the c:\ni-rt\system directory.
Requirements
Filename: 203620.zip
Software Requirements
Application Software: LabVIEW Full Development System 5.1
Language(s): LabVIEW
Reader Comments | Submit a comment »
Example is too old
Is there a newer example for e.g. LabVIEW 8.6?
- Jul 16, 2009
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
