该内容不适用于您选择的语言

该内容将以另一种语言显示出来。 您可使用浏览器的翻译功能查看内容。

Distributing a Real-Time Application with Shared Variables to Multiple Users

Updated Sep 14, 2023

Reported In

Software

  • LabVIEW Real-Time Module
  • LabVIEW
  • LabVIEW Application Builder Module

Issue Details

I have built a LabVIEW Real-Time application that uses network-published shared variables. I need to deploy this application to several targets that all have different IP addresses. How do I do this?

Solution

Whenever you create a LabVIEW project, a .aliases file is generated containing the name and IP address of any targets in the project. This file may look something like this:
[My Target Machine]
My Target Machine = "192.168.0.5"

[My Computer]
My Computer = "192.168.0.6"

When you build a VI into an executable application, an additional .aliases file is generated in the same directory as the built exe. You can alter this file when moving the application to a different host machine so that the application knows which RT target it needs to search for the shared variables. To do so:
  1. Browse to the local copy of the .aliases file for your application. It will be in the directory specified in the Destination directory property under the Information category of the build specification.
  2. Open the .aliases file in a text editor, such as Notepad.
  3. Change the names and IP addresses of the host and remote target to match the new system. The new host should now be able to find the shared variables hosted on the RT target.
    1. You should have something like this:
KB001.png

When a Real-Time startup application is built, a similar .aliases file is generated and deployed to the RT target. This file can be found at the following location:

For VxWorks or PharLap targets: c:\ni-rt\startup
For Linux RT targets: /home/lvuser/natinst/bin

If the shared variables are hosted on the PC, the .aliases file on the target must be modified to reference the right host PC. Use a file transfer method, such as FTP or WebDAV, to transfer the startup.aliases file from the directory specified above to the host PC. You can then edit the file with the correct information and transfer it back to the RT target.
 

Additional Information

If you are not sure of the IP address of the computer you will be deploying to, you can also edit this .aliases file programmatically during setup. It can be read and written to using the configuration file functions.