ApplyRTSystemImage
- Updated2023-02-21
- 5 minute(s) read
int ApplyRTSystemImage (char IPAddress[], char imagePath[], int options, ProgressCallbackType callback, void *callbackData);
Purpose
Applies an image to a target system, replacing its current configuration with that of the image. Call CreateRTSystemImage to create an image.
The target system must have an IP address in order to be imaged. You can configure a target IP stack by calling SetRTIPConfiguration. The imaging process preserves a target IP stack configuration and hostname.
Before copying the image to the target system, ApplyRTSystemImage deletes every file and directory on the C:\ drive. If the target system has a Windows installation, ApplyRTSystemImage deletes only the \NI-RT directory.
![]() |
Note Images created from Windows dual boot RT systems contain some Windows system files from the root directory. Because of this, National Instruments recommends that you not apply such an image to a different Windows dual boot system because the system files on the target are overwritten by the ones from the image, potentially corrupting the Windows installation. |
To prevent other applications from interfering with the imaging process, ApplyRTSystemImage locks the target system with the password kilgoretrout for the duration of the operation. If you locked the system with a different password, LabWindows/CVI restores the password after imaging completes.
Windows This function is supported only on Windows.
Parameters
Input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
IPAddress | char [] |
IP address or DNS-resolvable hostname of the system to image. You cannot apply an image to a system that is freshly formatted or otherwise unconfigured. You must first call SetRTIPConfiguration to configure its IP address and reboot it with RebootRTSystem. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
imagePath | char [] |
The path to the image directory. This is the directory that contains the RTCtrlr.ini file. Images are not compatible across different controller models because the drivers in an image are model-specific. You must specify an image that was created from a model that matches the target system. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
options | int |
A bitfield consisting of 0 or more RTUtilOptions bitwise OR-ed together:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
callback | ProgressCallbackType | A callback function that receives notification of events that occur on the system. You can pass NULL if you do not want to register a callback. The callback function, type ProgressCallback, takes the following form: int CVICALLBACK CallbackFunc (const char *systemIP, const char *systemMAC, int event, void *eventData1, void *eventData2, void *callbackData); The callback is executed in a separate thread every time a RTUtilEvent occurs on the system. If you are interested only in certain events, your callback must examine the event parameter passed in. The systemIP parameter contains the IP address of the system for which the event occurred. The systemMAC parameter contains the system MAC address. The callback return value is ignored. You do not need to explicitly unregister your callback. The callback stop receiving notifications once the operation for which it was registered has completed. Just before the callback is unregistered, it receives the RTUtilEvent_CallbackUnregistered event to indicate that it is safe to clean up callbackData, if necessary. The following lists RTUtilEvent events and relevant details for each event:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
callbackData | void * | A pointer-width value the library passes to the callback function through the callbackData parameter. You can use the callbackData as an integer value or as a pointer to a data object you want to access in the callback function. This way, you do not have to declare the data object as a global variable. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. Unless otherwise stated, zero indicates successful execution and a negative number indicates that an error occurred. You can call the GetRTUtilErrorString function to obtain a message that describes the error. |
Additional Information
Library: Real-Time Utility Library
Include file: rtutil.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later
Example
Refer to realtime\RTSystemImaging\RTSystemImaging.cws for an example of using the ApplyRTSystemImage function.