<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Python script for stopping a running online application</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4021f8e2b9/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4021f8e2b9/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/4021f8e2b9/</id><updated>2020-02-27T14:43:45.597000Z</updated><subtitle>Recent posts to Python script for stopping a running online application</subtitle><entry><title>Python script for stopping a running online application</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4021f8e2b9/?limit=25#a116" rel="alternate"/><published>2020-02-27T14:43:45.597000Z</published><updated>2020-02-27T14:43:45.597000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.comcf22748dad6fc799408d24754273af9c73804045</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Halim.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Halim hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
To stop the plc while staying logged in, I need to use the &amp;lt;onlineapp&amp;gt;.stop(). The problem is that I'm not able to keep the declaration of the &amp;lt;onlineapp&amp;gt; to a next run of the script. So, I want to "ask the scriptEngine what online application is existing now"? How could I program for this question knowing that there is nothing as &amp;lt;active_online_application&amp;gt; in the scriptEngine help?&amp;lt;/active_online_application&amp;gt;&amp;lt;/onlineapp&amp;gt;&amp;lt;/onlineapp&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ScriptEngine has no need to remember which online application exists because it is not necessary. Just create a new online application and check if it is logged in. If not, login and stop the running app.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Python script for stopping a running online application</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4021f8e2b9/?limit=25#1f60" rel="alternate"/><published>2020-02-27T14:43:45.062000Z</published><updated>2020-02-27T14:43:45.062000Z</updated><author><name>Halim</name><uri>https://forge.codesys.com/u/halim/</uri></author><id>https://forge.codesys.comc74d9f832df56ade8a4cdfff3953148451ceba99</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I could manage to write a script that creates an online application, log-in, and start the PLC as shown in the below function code. &lt;br/&gt;
def plc_start():       &lt;br/&gt;
        onlineapp = online.create_online_application(None)&lt;br/&gt;
        onlineapp.login(0,True)&lt;br/&gt;
        plc_login()&lt;br/&gt;
        onlineapp.start()&lt;br/&gt;
        print("started")&lt;/p&gt;
&lt;p&gt;To stop the plc while staying logged in, I need to use the &amp;lt;onlineapp&amp;gt;.stop(). The problem is that I'm not able to keep the declaration of the &amp;lt;onlineapp&amp;gt; to a next run of the script. So, I want to "ask the scriptEngine what online application is existing now"? How could I program for this question knowing that there is nothing as &amp;lt;active_online_application&amp;gt; in the scriptEngine help?&amp;lt;/active_online_application&amp;gt;&amp;lt;/onlineapp&amp;gt;&amp;lt;/onlineapp&amp;gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br/&gt;
Halim&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>