CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

create_boot_application()
https://forum.codesys.com/viewtopic.php?f=18&t=8345
Page 1 of 1

Author:  MKeo [ Tue Nov 28, 2017 3:31 pm ]
Post subject:  create_boot_application()

Hello!

Im trying to create a boot appl. with:

create_boot_application()


but every time i get this errormessage:

NameError: name 'create_boot_application()' ist not defined.


Could you help me please?

Thanks and best regards
MKeo

Author:  M.Keller [ Tue Nov 28, 2017 4:27 pm ]
Post subject:  Re: create_boot_application()

Hi MKeo.

MKeo wrote:
NameError: name 'create_boot_application()' ist not defined.

The method create_boot_application() is only available on an online application object.

Here some example code for the active appliction:
Code:
onlineApp = online.create_online_application()

# login with download
onlineApp.login(OnlineChangeOption.Never, True)

# create boot application on the PLC
onlineApp.create_boot_application()

# logout
onlineApp.logout()

BR
Martin

Author:  MKeo [ Wed Nov 29, 2017 7:37 am ]
Post subject:  Re: create_boot_application()

Thanks!

There must be an other option to create a boot application, because I have an option to do it manually, where I dont have to be online or to log in.

Im want to make a boot application from IScriptApplication. There also is a boot application at IScriptOnlineApplication.

It just asks where I want to save the application, so I dont need to log in.


My problem is, that I need to create the .app and .crc files. Manually it runs without any problem, but I want to create those two files with a python script.


BR,
MKeo

Author:  M.Keller [ Wed Nov 29, 2017 9:39 am ]
Post subject:  Re: create_boot_application()

MKeo wrote:
There must be an other option to create a boot application, because I have an option to do it manually, where I dont have to be online or to log in.

Im want to make a boot application from IScriptApplication. There also is a boot application at IScriptOnlineApplication.

It just asks where I want to save the application, so I dont need to log in.

Yes, there is. Get the script object for the application you want to create boot applicaiton for and call the method create_boot_application(path) with the path for the application file.

Here some example code:
Code:
proj = projects.primary

found = proj.find("Application", True)
if not found:
   raise Exception("Application was not found")
app = found[0]

app.create_boot_application(r"c:\temp\myapp.app")

BR
Martin

Author:  MKeo [ Wed Nov 29, 2017 9:58 am ]
Post subject:  Re: create_boot_application()

Now it works!

Thank you very much!

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/