The changeIPAddress function block provides the capability to change dynamically a controller IP address, its subnet mask and its gateway address. The function block can also save the IP address so that it is used in subsequent reboots of the controller.
Input |
Type |
Comment |
---|---|---|
xExecute |
BOOL |
|
xSave |
BOOL |
TRUE: save configuration for subsequent reboots of the controller. |
eChannel |
changeIPAddress_Channel |
The input eChannel is the Ethernet port to be configured. Depending on the number of the ports available on the controller, it is one of 5 values in changeIPAddress_Channel (0 or 1). |
i_abyIPAddress |
ARRAY[0..3] OF BYTE |
The new IP Address to be configured. Format: 0.0.0.0. |
i_abyIPMask |
ARRAY[0..3] OF BYTE |
The new subnet mask. Format: 0.0.0.0 |
i_abyIPGateway |
ARRAY[0..3] OF BYTE |
The new gateway IP address. Format: 0.0.0.0 |
Output |
Type |
Comment |
---|---|---|
xDone |
BOOL |
TRUE: if IP Addresses have been successfully configured or if default IP Addresses have been successfully configured because input i_abyIPAddress is set to 0.0.0.0. |
xBusy |
BOOL |
Function block active. |
xError |
BOOL |
|
eError |
changeIPAddress_Error |
|
xSaved |
BOOL |
Configuration saved for the subsequent reboots of the controller. |
q_abyIPAddress |
ARRAY[0..3] OF BYTE |
Current controller IP address. Format: 0.0.0.0. |
q_abyIPMask |
ARRAY[0..3] OF BYTE |
Current subnet mask. Format: 0.0.0.0. |
q_abyIPGateway |
ARRAY[0..3] OF BYTE |
Current gateway IP address. Format: 0.0.0.0. |
The changeIPAddress_Channel enumeration data type contains the following values:
Enumerator |
Value |
Description |
---|---|---|
CHANNEL_ETHERNET_NETWORK |
0 |
M241, M251MESC, M258, LMC058, LMC078: M251MESE: |
CHANNEL_DEVICE_NETWORK |
1 |
M241: M251MESE: |
CHANNEL_M262_ETH1 |
2 |
|
CHANNEL_M262_ETH2 |
3 |
|
CHANNEL_M262_TMS1 |
4 |
1st |
The changeIPAddress_Error enumeration data type contains the following values:
Enumerator |
Value |
Description |
---|---|---|
ERR_NO_ERROR |
00 hex |
No error detected. |
ERR_UNKNOWN |
01 hex |
Internal error detected. |
ERR_INVALID_MODE |
02 hex |
IP address is not configured as a fixed IP address. |
ERR_INVALID_IP |
03 hex |
Invalid IP address. |
ERR_DUPLICATE_IP |
04 hex |
The new IP address is already used in the network. |
ERR_WRONG_CHANNEL |
05 hex |
Incorrect Ethernet communication port. |
ERR_IP_BEING_SET |
06 hex |
IP address is already being changed. |
ERR_SAVING |
07 hex |
IP addresses not saved due to a detected error or no non-volatile memory present. |
ERR_DHCP_SERVER |
08 hex |
A DHCP server is configured on this Ethernet communication port. |