<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Get Deviceaddress of CPU via Python an Login via Test Manager</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8bf4bff58d/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8bf4bff58d/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/8bf4bff58d/</id><updated>2020-02-27T14:58:32.808000Z</updated><subtitle>Recent posts to Get Deviceaddress of CPU via Python an Login via Test Manager</subtitle><entry><title>Get Deviceaddress of CPU via Python an Login via Test Manager</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8bf4bff58d/?limit=25#ed41" rel="alternate"/><published>2020-02-27T14:58:32.808000Z</published><updated>2020-02-27T14:58:32.808000Z</updated><author><name>Sebastian-abb</name><uri>https://forge.codesys.com/u/sebastian-abb/</uri></author><id>https://forge.codesys.com5950df1a6d6cc135a97e41f38a9f5fd115800902</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;thanks for the quick answer. I need the address because I use Unit Test´s with the Testmanager and for this Type of test  the Testmanager needs the Deviceaddress. The second reason is that i work with the Automation Builder from ABB and with different versions of the Automationbuilder the deviceaddress changes and so i have to read it out with every Version i use my test on.&lt;/p&gt;
&lt;p&gt;Best regards &lt;br/&gt;
Sebastian&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get Deviceaddress of CPU via Python an Login via Test Manager</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8bf4bff58d/?limit=25#26b8" rel="alternate"/><published>2020-02-27T14:58:32.209000Z</published><updated>2020-02-27T14:58:32.209000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com5eb80a4f61d7628d0c5b0b0bf57b99dcc24880f7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Sebastian.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Sebastian_abb hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hello, &lt;br/&gt;
I have a question and i hope you can help me. I want to use Python (see Code below) to get the deviceadress of my CPU an than use this address to login into the CPU via the Test Manager. &lt;br/&gt;
If i use the code i get the right information out of the CPU but if i try to use " deviceaddress " out of Pythonscript in my Testscript, the Testmanager says the Format is invalid. &lt;br/&gt;
Is this error because the Address is of type "string", or do i have to use a other way to get the address out of the script?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For what reason do you want to get the device address through the Scripting and use it to login through the Test Manager?&lt;/p&gt;
&lt;p&gt;If the communication path for the device is already configured then you can just login with your test script. If you want to use the Scripting API for the gateways to scan the network and find a suitable device then you can just configure the communication path through Scripting and also just login in the test script.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get Deviceaddress of CPU via Python an Login via Test Manager</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/8bf4bff58d/?limit=25#b894" rel="alternate"/><published>2020-02-27T14:58:30.240000Z</published><updated>2020-02-27T14:58:30.240000Z</updated><author><name>Sebastian-abb</name><uri>https://forge.codesys.com/u/sebastian-abb/</uri></author><id>https://forge.codesys.com9e68ace3134e4feec3efee0bbf53a9c833991dbe</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, &lt;br/&gt;
I have a question and i hope you can help me. I want to use Python (see Code below) to get the deviceadress of my CPU an than use this address to login into the CPU via the Test Manager. &lt;/p&gt;
&lt;p&gt;If i use the code i get the right information out of the CPU but if i try to use " deviceaddress " out of Pythonscript in my Testscript, the Testmanager says the Format is invalid. &lt;br/&gt;
Is this error because the Address is of type "string", or do i have to use a other way to get the address out of the script?&lt;/p&gt;
&lt;p&gt;Best regards &lt;/p&gt;
&lt;p&gt;Sebastian&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt; &lt;span class="k"&gt;object&lt;/span&gt;
&lt;span class="k"&gt;found&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'PLC_AC500_V3'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'PLC_7'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;found&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;found&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'No or more than one device found'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;dev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;found&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="o"&gt;==============&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;Find&lt;/span&gt; &lt;span class="n"&gt;gateway&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;span class="n"&gt;deviceid&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_device_identification&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;devicegateway&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_gateway&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;devicegateway&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;deviceaddress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_address&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceaddress&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;Output&lt;/span&gt; &lt;span class="mi"&gt;03&lt;/span&gt;&lt;span class="n"&gt;C8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;9000&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;DDC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;C0A8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;090&lt;/span&gt;&lt;span class="n"&gt;B&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;'type'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deviceaddress&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry></feed>