Dear Kunz,
the basis is this example:
https://store.codesys.com/caa-device-di ... ample.htmlIn the method DeviceController\Reset I pass the desired IP address.
Var
itfAdapter : IoDrvEthernetIP.IRemoteAdapter2;
abyIp : ARRAY [0..3] OF BYTE := [192,168,99,140];
end_var
IF itfDevice <> 0 THEN
(* with CheckSupportedCommunicationState() it is possible to check whether the requested state can be performed in general. *)
IF itfDevice.CheckSupportedCommunicationState(DED.DEVICE_TRANSITION_STATE.RESET) THEN
(* with CheckCurrentSupportedCommunicationState() it is possible to check whether the device can be reset right now. *)
IF itfDevice.CheckCurrentSupportedCommunicationState(DED.DEVICE_TRANSITION_STATE.RESET) THEN
IF __QUERYINTERFACE(itfDevice, itfAdapter) THEN
itfAdapter.IPAddress := abyIp;
END_IF
(* reset the device*)
itfDevice.SetCommunicationState(DED.DEVICE_TRANSITION_STATE.RESET);
Good luck