LabWindows/CVI Real-Time Module

SetRTIPConfiguration

  • Updated2023-02-21
  • 3 minute(s) read

int SetRTIPConfiguration (char address[], int addressType, SystemIPSettings *IPSettings);

Purpose

Changes the IP configuration settings of an RT system.

Note   LabWindows/CVI does not apply changes to the IP settings until the next time you reboot. If you query the system IP settings after calling this function but before rebooting, GetRTSystemInfo returns the original settings. To initiate a reboot, call RebootRTSystem.

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.

Note    Newly formatted or otherwise unconfigured systems, which appear in MAX 0.0.0.0, do not have assigned IP addresses. To call this function on an unconfigured system, you must specify its MAC address.
addressType int Specifies the type of address string you pass to the address parameter.

You can pass one of the following values:

Value Description Example
AddressType_IP An IP address or DNS-resolvable hostname. 127.0.0.1
SomeHost
AddressType_MAC A MAC address. 01:23:45:AB:CD:EF
IPSettings SystemIPSettings * A pointer to a SystemIPSettings structure that contains the new IP settings.

You must fill out all fields of the structure appropriately, even if you want to change only one setting. You can reuse the SystemIPSettings ip field of the RTSystemInfoPtr returned by GetRTSystemInfo or FindAllRTSystemsOnSubnet. Edit the values you want to change, and pass the updated SystemIPSettings pointer into this function.

If you set usingDHCP to true, this function ignores any addresses you specify, and the system instead uses DHCP to set its IP stack.

Note   LabWindows/CVI does not apply changes to the IP settings until the next time you reboot. If you query the system IP settings after calling this function but before rebooting, SetRTIPConfiguration returns the original settings. To initiate a reboot, call RebootRTSystem.

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

Examples

Refer to the following examples that use the SetRTIPConfiguration function:

  • realtime\RTConfig\RTConfig.cws

    Open example
  • realtime\RTSystemImaging\RTSystemImaging.cws

    Open example

Log in to get a better experience