Real-Time Target System Replication
Overview
This paper explains the use and use cases of system replication VI’s and a system replication executable for the replication of LabVIEW Real-Time targets. The tools provided can be used to replicate one Real-Time target into multiple copies of itself, circumventing the use of the National Instruments Measurement and Automation Explorer (MAX) and an FTP client in favor of a simple utility or the ability to customize your own using LabVIEW.
These VI’s and the built executable are useful in the case of deploying many Real-Time systems, or in the case of backing up and reinstalling a Real-Time system in the field where multiple copies of MAX or the LabVIEW development system may not be available. These are ideal for OEMs and users with multiple identical targets who can greatly benefit by having a set of VI’s and executables that address the issues of saving entire target configurations or deploying an image to multiple targets. The VI’s require the Internet Toolkit for LabVIEW in order to implement FTP (File Transfer Protocol) functions.
It is important to remember that images can only be deployed to identical systems. This is due to the fact that different versions of the operating system, driver files, and databases that maintain hardware identification are deployed to each different type of target. For PXI- and PCI-based controllers, problems may arise if multiple identical systems are viewed and configured from the same host after using the full image replication technique. This is because the database which stores the configuration of hardware is not safe for duplication.
Table of Contents
Using the Example Executable
For many users, the example executable may be sufficient for their replication needs. It can be run on a Windows desktop, or run from the command line or within a batch file as part of an installer. The executable run from the desktop provides an intuitive graphical user interface best suited to description here. Following this description, the VI’s will be explained. The VI’s allow for more functionality and flexibility than the example executable utility.
Storing an Image
Ordinarily the development process results in a Real-Time target with the necessary set of drivers and a built executable. For later replication to identical systems, the replication executable stores the image of these drivers and optionally the rest of the hard drive contents. To copy the contents of the remote hard drive to the local file system, only a few steps are necessary:

1. In the utility, select RT Target to be the source as in the screen capture above. Then, press the adjacent Browse… button to choose an RT Target to serve as the Master.

Pressing the browse button creates a list of Real-Time targets available on the local subnet, as shown above. IP address, MAC address (a unique identifier assigned to individual network interface cards), Name, and Model are given to aid identification of the right remote machine. Choose the machine you would like to replicate, then press OK.

2. Next choose destination to be Folder, then select the directory in the local file system where you would like to keep the master image.
3. Press start, and the backup process begins. At the end of the process, the Messages window should display “Image created successfully.”

Deploying a Stored Image
This utility assumes the targets of interest are ready to accept file transfers. This means that they must have a valid IP address assigned. This is done from within MAX, and for the purposes of this utility would have been assigned by someone with a copy of MAX and knowledge of setting IP addresses for remote Real-Time targets.
1. Select Folder as the source this time. Then browse to or type in the path to the image stored in the previous section.
2. Select RT Target as the destination. Either type in the IP address of the desired target or use the Browse… button to interactively select a target.
3. Now press start to begin the process of copying the previously stored image. Note that images can only be deployed to identical systems.
Other Possibilities
The Source and Destination sections can be configured to allow for the following use-cases:
1. RT Target >> Folder - Backing up Target to a Folder on the Host machine.
2. RT Target >> RT Target – Replicating one system to another on the same network
3. Folder >> RT Target – Deploying a saved image to a target
The Installed Software checkbox can be chosen to only install the components on the target which would be installed by MAX (National Instruments software and drivers). In other words, it won’t copy any other files on the hard drive or built executables. In the case of leaving the Installed Software box un-checked, the entire image of the hard drive will include some hardware databases that are not meant to be duplicated to multiple machines. This is only problematic if the duplicates are viewed from the same host computer, and changes to DAQ or other hardware configurations are made after the replication process is complete.
Dual-Boot Controllers
National Instruments does not recommend using the Replication Tools or example programs for replication of Dual-Boot Windows/LabVIEW Real-Time systems. Certain Windows-related files may be sensitive to overwriting, such that applying the image adversely affects the existing Windows installation. The tools will only attempt to add or overwrite files to the root ( C:\ ) directory and the Real-Time related directories. Windows installs some files to the root folder, the user may wish to remove these from the stored image so they won't overwrite any existing ones on the target machine.
Using the System Replication VIs
The System Replication VI’s allow creation of custom VI’s and executables for performing replication and backup operations. As an example, a systems integrator can use such an executable to deploy upgrades of software to customers without requiring customers to install drivers, or use MAX and an FTP client to execute the update.
The next section discusses a highly simplified example VI to install a stored image to a target which has no software installed and no configured IP address. Remaining VI’s are discussed in brief after this example.
Apply Image to Unconfigured Target.vi
This simple example finds a target in a freshly formatted (what is noted in MAX as Unconfigured-- without IP address applied) state and applies a selected image to it. It is intended as a starting point for understanding the usage of the VI’s, and is not provided as a solution by National Instruments.

The front panel provides steps to follow in order to use the VI. First, choose the path to the stored image, and choose a hostname to apply to the target. This name should distinguish the target from other targets in some way. Next, press the Run button to begin the rest of the VI.
After a few seconds, the middle section of the front panel should display a MAC and IP address and a model name (such as PXI-8196) for every un-configured target found. Use the index control to choose the target of interest and select the Image… button to proceed with installing the image.
After several seconds (time to completion will vary based on network traffic and hardware) the assigned IP address (assigned by DHCP) is displayed, and the image has been successfully copied, including any startup executables and support files.
Now, examine the block diagram to learn about the System Replication VI’s.

First, the VI called Find All Targets.vi executes. The Boolean True constant wired into this VI selects that only un-configured targets will be returned. This means only targets which do not have IP addresses assigned will be returned. The returned array of clusters contains details about each target found: Name, MAC address, Model Code, IP address, and more. These can be used to filter the list for certain models of target. This is especially useful for automated imaging since an image should only be applied to an identical target. For example, the array of clusters can be parsed to find only PXI-8176 controllers.

Next, after the user selects the target of interest, that target’s MAC address is unbundled by name, and passed on to Set IP Address.vi. This VI can enable or disable DHCP (automatic IP assignment), and set IP, Subnet, Gateway, and DNS addresses. It also applies a hostname to the target. The VI outputs the assigned IP address, which is especially useful in the case of DHCP, which automatically finds an available IP address and could therefore result in unpredictable addresses.
Set Target Image.vi
This IP address is passed along to the VI Set Target Image.vi. This VI performs the final task of copying the stored master image to the duplicate machine. The VI detects Windows installations and avoids overwriting Windows and related files. Therefore it is safe to perform Set Target Image on dual-boot targets, though as noted this may require additional tweaking of the stored image. The VI also preserves IP address settings rather than overwriting them with the master’s settings. An ordinary FTP transfer would overwrite the IP address settings. This VI can also restrict images to be applied only to the exact same target, as verified via MAC address.
This is a simplified example which is intended to provide inspiration for creating a more customized interface, or perhaps even a one-click utility to upgrade or restore a deployed system. The remaining VI’s which have not yet been discussed will prove useful in designing a custom replication application:
Other VI's In the API
Get Target Info (IP).vi and Get Target Info (MAC).vi
These two VI’s search for a single target based on its IP or MAC address and returns the same information as Find All Targets.vi, but only for the single specified target. It is useful for verifying that the IP or MAC address corresponds to the right Model, for example.
Format Target.vi
Format Target formats the disk of remote targets. This is supported on targets that do not need a floppy disk to boot into safe mode. For targets that my create several files during execution, or may need frequent upgrades or application changes, this may prove useful. Older targets may not support this function; this is because their firmware has not been updated. Applying the most recent firmware update will remedy the situation.
Get Target Image.vi
This VI saves the target image to the specified directory. A Boolean input determines if all files on the target are copied, or only those that are normally installed by MAX. If all files are copied, any executable that has been set as startup will also run at startup on the duplicate machine.
Replication, RIO, and FPGA Personalities
Targets with Reconfigurable IO (NI-RIO) FPGA targets as part of the system (such as compactRIO or targets with PCI or PXI R-series hardware) may have special replication needs.
NI-RIO System Replication VI's complement the Real-Time System Replication API with added RIO-specific functions. These tools have the ability to erase and download a Bitfile to the Flash, to set how a VI is loaded from Flash Memory, and also to set the Analog Input mode of R-series devices.
For more information and links to download these VI's, read the Developer Zone Tutorial FPGA Target System Replication.
Going Further
The next step is to create an application that suits your replication needs. For example, by altering the stored image to include/exclude a custom set of files one can further customize the image or images applied to machines. The stored image is simply a local copy of the original machine's file hierarchy, and can therefore be altered using ordinary File IO operations. Coupled with further filtering of machines by Model, MAC address, or other means empowers the user to create a flexible configuration utility.
Download
Download the LabVIEW Real-Time System Replication Tools
Please provide feedback, suggestions, and questions in the LabVIEW Real-Time Application Deployment discussion forum.
Conclusion
Using the VI's and examples provided, a variety of system replication applications can be made. Integrators who wish to prevent their users from opening or installing MAX, and any users who intend to duplicate multiple machines, will find them flexible and useful. These VI's will be updated periodically, so be sure to check the Drivers and Updates page for new versions. The VI's are stored under Support > Drivers and Updates > All Versions > LabVIEW > Real-Time Module
Reader Comments | Submit a comment »
RTCP fails to restore one thing
In using the RTCP tool to make an image of my PXI
system, it fails to restore one thing.
My devices are named "CTR", "DIO", "RTEC" and such, so
that the program doesn't have to know which device is
which - they can plug them in in any order, and have it
work.
When I make an image and restore it, everything is OK
except for the names. They have reverted to "Dev1",
"Dev2", etc., so my code doesn't work until I rename them.
Any ideas?
P.S.
the address "http://forums.ni.com/ni/board/message?
board.id=RTControl&thread.id=18" mentioned earlier
doesn't go anywhere useful.
- Steve Bird, Culverson Software. sbird@culverson.com - Oct 24, 2008
I too modified the vi to allow setting an
IP so I could use it with systems on a
different subnet. Otherwise it worked
very well for me. Thanks
- Dana Cox, Fairchild Semiconductor. dana.cox@fairchildsemi.com - Jul 31, 2008
Feedback Forum
Please post additional feedback and
suggestions for RT
deployment/replication tools in the
following forum.
http://forums.ni.com/ni/board/message?
board.id=RTControl&thread.id=18
- Christian Loew, National Instruments. christian.loew@ni.com - Jul 25, 2008
Works well
RT copy worked well for me on a PXI
target. For "Apply Image To
Unconfigured Target.vi", I would suggest
adding a Fixed IP address option on the
front panel and a running installation
update like the Message indicator on RT
copy. I had to alter the VI because we
used fixed IP on some VLANs. After the
installation started, I wondered at times
if it was running.
- Phillip Neir, GM Engineering. phillip.g.neir@gm.com - Jan 16, 2008
Lets try asking more constructive
questions or providing better solutions
instead of bashing something that NI is
just giving out for free. Anyways, these
issues appear to be fixed with the latest
download. Make sure you have the
Internet toolkit installed in order to
access TCP Arbitrary Listener.
- craig.eidson@optimation.us - Jan 3, 2008
Do this work on LabView 8.5?
I have some problem using this VI's on
LabView 8.5. There are some missing VI's (TCP
Create Arbitrary Listener.vi, and some other
TCP vi's). Is this local to my computer or
have NI changed some of their TCP vi's.
- even.larsen@fueltech.no - Nov 8, 2007
Still password protected. Have any of these
submissions been answered?
- javier.ortiz@gd-ais.com - Oct 9, 2007
Password??
Kind of disappointing that the article
expects you to be able to view the block
diagram, but you can't do that without a
password that they don't tell you.
Whomever maintains this article, let's
remove the password-protection.
- Sep 4, 2007
I think that it is poor that NI does not
provide a supported solution for this
issue. I have to waste valuable time
developing and testing a tool that should
be provided.
- Jason Hannam, Impact Drilling Solutions. jhannam@impact-es.com - Jun 27, 2007
locked block diagrams
Why make a util like this and lock the block
diagrams on the some of the VIs?
- David Wisti, Intergrated Industrial Systems. dwisti@i2sworld.com - May 14, 2007
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial 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 content with each new revision of related products and drivers. THIS TUTORIAL 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/).
