FB_MDP_NIC_Write_IP 1:

The function block enables a new IP address to be set. This element is part of the IPC diagnostics Moduls NIC.

Please note that changes of this kind affect an existing network connection to the computer.


    bExecute     : BOOL;
    nDynModuleId : BYTE;             (* the dynamic module id *)
    sIPAddress   : T_MaxString;      (* IP Address *)
    tTimeout     : TIME := DEFAULT_ADS_TIMEOUT; (* States the time before the function is cancelled. *)
    sAmsNetId    : T_AmsNetId;       (* keep empty '' for the local device *)

bExecute: The function block is called by a rising edge on the input bExecute, if the block is not already active.

nDynModuleId: The dynamic Module ID belonging to the selected network module is specified at this input.

sIPAddress: The IP address specified at this input in the form of a string is transmitted.

tTimeout: Specifies a maximum length of time for the execution of the function block.

sAmsNetId: To execute the query on the local device, it is not necessary to specify this input variable. Alternatively, an empty string can be specified. To direct the query to another computer, its AMS Net Id (of type T_AmsNetId) can be specified here.


    bBusy  : BOOL;
    bError : BOOL;
    nErrID : UDINT;

bBusy: This output is TRUE as long as the function block is active.

bError: Becomes TRUE as soon as an error situation occurs.

nErrID: Returns an error code if the bError output is set.


Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)