CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Feb 23, 2020 2:04 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Aug 01, 2019 12:16 pm 
Offline

Joined: Thu Oct 25, 2018 2:41 pm
Posts: 9
Hi.

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.
def plc_start():
onlineapp = online.create_online_application(None)
onlineapp.login(0,True)
plc_login()
onlineapp.start()
print("started")

To stop the plc while staying logged in, I need to use the <onlineapp>.stop(). The problem is that I'm not able to keep the declaration of the <onlineapp> 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 <active_online_application> in the scriptEngine help?

BR,
Halim


Top
   
PostPosted: Tue Aug 06, 2019 7:40 am 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 262
Hi Halim.

Halim wrote:
To stop the plc while staying logged in, I need to use the <onlineapp>.stop(). The problem is that I'm not able to keep the declaration of the <onlineapp> 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 <active_online_application> in the scriptEngine help?

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.

BR
Martin

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited