<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Error while using UpdateConfiguredIPSettings to change IP address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b68a1b954f/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b68a1b954f/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b68a1b954f/</id><updated>2024-02-19T07:05:10.987000Z</updated><subtitle>Recent posts to Error while using UpdateConfiguredIPSettings to change IP address</subtitle><entry><title>Error while using UpdateConfiguredIPSettings to change IP address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b68a1b954f/?limit=25#4ae4" rel="alternate"/><published>2024-02-19T07:05:10.987000Z</published><updated>2024-02-19T07:05:10.987000Z</updated><author><name>ragarcia</name><uri>https://forge.codesys.com/u/ragarcia/</uri></author><id>https://forge.codesys.comf1e6c09b8234ab92875424f99419efa96d62ec6a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I did check I cannot see any error log. It is when executing the Reconfigure function that I get an error as return from that function.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error while using UpdateConfiguredIPSettings to change IP address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b68a1b954f/?limit=25#9b45" rel="alternate"/><published>2023-12-12T04:52:23.985000Z</published><updated>2023-12-12T04:52:23.985000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com46ba9aa4d4992718716d107fac11e0dbaa26dd1a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;check the plclog for the error on doing this&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error while using UpdateConfiguredIPSettings to change IP address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b68a1b954f/?limit=25#cecd" rel="alternate"/><published>2023-12-11T16:13:20.189000Z</published><updated>2023-12-11T16:13:20.189000Z</updated><author><name>ragarcia</name><uri>https://forge.codesys.com/u/ragarcia/</uri></author><id>https://forge.codesys.comd05b8906fcba430f9b541370a4ef9258d3735a51</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone, I am trying to change dynamically by code the IP address of a Weidmuller controller. So I am basically using IoDrvEthernet library to use UpdateConfiguredIPSettings function but I am getting constantly the 'INVALID_STATE' error.&lt;/p&gt;
&lt;p&gt;Even though I am following a procedure it should work:&lt;br/&gt;
* First I added on the config file of codesys the following:&lt;br/&gt;
&lt;span&gt;[SysSocket]&lt;/span&gt;&lt;br/&gt;
Adapter.0.Name="eth0"&lt;br/&gt;
Adapter.0.EnableSetIpAndMask=1&lt;br/&gt;
Adapter.1.Name="eth1"&lt;br/&gt;
Adapter.1.EnableSetIpAndMask=1&lt;br/&gt;
* Secondly I am first disabling the ethernet interface by using Ethernet_0.Enable = FALSE and then executing DED.Reconfigure. After that, I run the Ethernet_1.updateConfiguredIPSettings&lt;/p&gt;
&lt;p&gt;Code:&lt;br/&gt;
Ethernet_1.Enable:= EnableDisable;&lt;/p&gt;
&lt;p&gt;Reconfigure(xExecute:= TRUE, &lt;br/&gt;
            itfNode:= Ethernet_1,&lt;br/&gt;
            xError=&amp;gt; ErrorReconfigure,&lt;br/&gt;
            eError=&amp;gt; ErrorCodeReconfigure);&lt;/p&gt;
&lt;p&gt;IF Reconfigure.xDone THEN&lt;br/&gt;
    ErrorCodeIP:= Ethernet_1.UpdateConfiguredIPSettings(IPAddress:= newIP,&lt;br/&gt;
                                                        SubnetMask:= newMask,&lt;br/&gt;
                                                        Gateway:= newGW);&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;IF Reconfigure.xDone OR Reconfigure.xError THEN&lt;br/&gt;
    Reconfigure(xExecute:= FALSE);&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;Ethernet_1.Enable:= TRUE;&lt;/p&gt;
&lt;p&gt;Reconfigure(xExecute:= TRUE, itfNode:= Ethernet_1);&lt;/p&gt;
&lt;p&gt;IF Reconfigure.xDone OR Reconfigure.xError THEN&lt;br/&gt;
    Reconfigure(xExecute:= FALSE);&lt;br/&gt;
END_IF    &lt;/p&gt;
&lt;p&gt;Can someone help me? Thank you. All I am trying is to find a way to change dynamically with code, the IP addresses of my controller (2 ethernet ports).&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>