<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Change User-Defined parameters of a Device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/47e9e3ef33/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/47e9e3ef33/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/47e9e3ef33/</id><updated>2020-02-27T14:45:09.484000Z</updated><subtitle>Recent posts to Change User-Defined parameters of a Device</subtitle><entry><title>Change User-Defined parameters of a Device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/47e9e3ef33/?limit=25#59f8" rel="alternate"/><published>2020-02-27T14:45:09.484000Z</published><updated>2020-02-27T14:45:09.484000Z</updated><author><name>AndreasDeDeDe</name><uri>https://forge.codesys.com/u/andreasdedede/</uri></author><id>https://forge.codesys.comb63b162469cfe49f1352ceda2be862943a57275d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I found the correct parameters:&lt;/p&gt;
&lt;p&gt;device.connectors&lt;span&gt;[0]&lt;/span&gt;.host_parameters&lt;/p&gt;
&lt;p&gt;and the concrete parameters are accessible over&lt;/p&gt;
&lt;p&gt;masterParams = master.connectors&lt;span&gt;[0]&lt;/span&gt;.host_parameters&lt;/p&gt;
&lt;p&gt;masterParams.by_id(id)&lt;/p&gt;
&lt;p&gt;and id can be found with the printtree function (i guess, or it was another tree func, it's been a while. anyway, it's helpful):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;printtree_rec&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;treeobj&lt;/span&gt;, &lt;span class="nv"&gt;depth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
   &lt;span class="nv"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;treeobj&lt;/span&gt;.&lt;span class="nv"&gt;get_name&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;False&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;    
   &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;treeobj&lt;/span&gt;.&lt;span class="nv"&gt;is_device&lt;/span&gt;:
      &lt;span class="nv"&gt;deviceid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;treeobj&lt;/span&gt;.&lt;span class="nv"&gt;get_device_identification&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;
      &lt;span class="nv"&gt;print&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{0} - {1} {2}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;.&lt;span class="nv"&gt;format&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;depth&lt;/span&gt;, &lt;span class="nv"&gt;name&lt;/span&gt;, &lt;span class="nv"&gt;deviceid&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt;
   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;child&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;treeobj&lt;/span&gt;.&lt;span class="nv"&gt;get_children&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;False&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
      &lt;span class="nv"&gt;printtree_rec&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;child&lt;/span&gt;, &lt;span class="nv"&gt;depth&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;printTree&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;proj&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
   &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;obj&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;proj&lt;/span&gt;.&lt;span class="nv"&gt;get_children&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;:
      &lt;span class="nv"&gt;printtree_rec&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;obj&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Change User-Defined parameters of a Device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/47e9e3ef33/?limit=25#58c3" rel="alternate"/><published>2020-02-27T14:45:07.980000Z</published><updated>2020-02-27T14:45:07.980000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com1b0a25ddeed55a93dd66e553ffba95f07f02f559</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi AndreasDeDeDe.&lt;/p&gt;
&lt;p&gt;There are device parameters and there are host parameters. Maybe your device has no device parameters.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=18&amp;amp;t=7552&amp;amp;p=17088&amp;amp;lan=en" rel="nofollow"&gt;previous post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Change User-Defined parameters of a Device</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/47e9e3ef33/?limit=25#c89b" rel="alternate"/><published>2020-02-27T14:45:07.439000Z</published><updated>2020-02-27T14:45:07.439000Z</updated><author><name>AndreasDeDeDe</name><uri>https://forge.codesys.com/u/andreasdedede/</uri></author><id>https://forge.codesys.com03d2c0e4f5e47a2580cf4309335c2aea19a72306</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello there,&lt;/p&gt;
&lt;p&gt;i have a device object in my python script which has user-defined parameters which are shown in the codesys gui in the "general" tab of said device. how can i access and modify these in my python script? i already found the ```&lt;/p&gt;
&lt;p&gt;myDevice.device_parameters&lt;/p&gt;
&lt;p&gt;&lt;code&gt;list, but&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;len(myDevice.device_parameters)&lt;/p&gt;
&lt;p&gt;``` equals zero.&lt;/p&gt;
&lt;p&gt;what is the right name for the list of user-defined parameters?&lt;/p&gt;
&lt;p&gt;Greetings&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>