FormatRTSystem
- Updated2023-02-21
- 5 minute(s) read
int FormatRTSystem (char address[], int addressType, int options, ProgressCallbackType callback, void *callbackData);
Purpose
Reformats the hard drive of a system, completely erasing all data.
![]() |
Note RT desktop PCs and PXI controllers with floppy disk drives are not supported. These types of systems lack the internal ROM used to boot to safe mode. |
After you reformat, the target is in an unconfigured state without an IP address and continues to boot into safe mode until you configure the target with software.
Windows This function is supported only on Windows.
Parameters
Input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
address | char [] | Specifies RT system on which to operate. You can pass the IP address, DNS-resolvable hostname, or MAC address. You must specify IP addresses in dot-decimal format, as a sequence of 4 decimal octets separated by dots. An example of an IP address is 127.0.0.1. You must specify MAC addresses as a sequence of 6 hexadecimal octets separated by colons. An example of a MAC address is 00:AB:11:CD:2e:3f. Letters can be uppercase, lowercase, or mixed case.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
addressType | int |
Specifies the type of address string you pass to the address parameter. You can pass one of the following values:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
options | int | A bit field consisting of 0 or more RTUtilOption flags bitwise OR-ed together. You can specify the following flag:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
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\RTConfig\RTConfig.cws for an example of using the FormatRTSystem function.