<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Set up the gateway and device by IP address and device address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/</id><updated>2022-05-04T15:19:25.621000Z</updated><subtitle>Recent posts to Set up the gateway and device by IP address and device address</subtitle><entry><title>Set up the gateway and device by IP address and device address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/?limit=25#4144/82c2" rel="alternate"/><published>2022-05-04T15:19:25.621000Z</published><updated>2022-05-04T15:19:25.621000Z</updated><author><name>tusharb</name><uri>https://forge.codesys.com/u/tusharb/</uri></author><id>https://forge.codesys.com12e858bf217918338bf5e0fdbb2eb83357f4671a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Your code will add only new Gateway. Do you know how to set default device to that gateway using Python script?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Set up the gateway and device by IP address and device address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/?limit=25#4144" rel="alternate"/><published>2020-02-27T14:48:35.288000Z</published><updated>2020-02-27T14:48:35.288000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com2f79afed2f3e748b63ca2354f2577cfddcd5555d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi chenhe.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;chenhe hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I'd like to have the example for creating new gateway.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I attached an example for creating a gateway.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=2604" rel="nofollow"&gt;gateway_add_new.py &lt;span&gt;&lt;span&gt;[889 Bytes]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Set up the gateway and device by IP address and device address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/?limit=25#7ede" rel="alternate"/><published>2020-02-27T14:48:34.736000Z</published><updated>2020-02-27T14:48:34.736000Z</updated><author><name>chenhe</name><uri>https://forge.codesys.com/u/chenhe/</uri></author><id>https://forge.codesys.combb86174c6762bdfde937c3eaf30aa5b9535fa3a5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello M.Keller,&lt;/p&gt;
&lt;p&gt;I'd like to have the example for creating new gateway. Thanks again.   &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;M.Keller hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
If you don't have a gateway you can create one with . You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>Set up the gateway and device by IP address and device address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/?limit=25#6c5f" rel="alternate"/><published>2020-02-27T14:48:33.169000Z</published><updated>2020-02-27T14:48:33.169000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com174f127ec3fbda3a44d3b5e986c2f0be1d4c2081</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi chenhe.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;chenhe hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I wonder if it is possible now to set up the gateway and device by IP address and device address?&lt;br/&gt;
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With CODESYS V3.5 SP9 or newer you can use the method  to specify the IP address for the device. &lt;/p&gt;
&lt;p&gt;You can find your gateway object by its name with the following code:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;gw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;online&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gateways&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Gateway-1'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you don't have a gateway you can create one with . You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Set up the gateway and device by IP address and device address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9534bb4d47/?limit=25#a522" rel="alternate"/><published>2020-02-27T14:48:32.607000Z</published><updated>2020-02-27T14:48:32.607000Z</updated><author><name>chenhe</name><uri>https://forge.codesys.com/u/chenhe/</uri></author><id>https://forge.codesys.coma6ae8ed9594ed825e8b3df1bfc5be4395afe752a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;I wonder if it is possible now to set up the gateway and device by IP address and device address?&lt;br/&gt;
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
projects.primary.find("Device name", True)&lt;br/&gt;
get_gateway() &lt;br/&gt;
get_address() &lt;br/&gt;
set_gateway_and_address(gateway, address) &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thank you in advance  &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>