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

Issues with create_boot_project
https://forum.codesys.com/viewtopic.php?f=18&t=9916
Page 1 of 1

Author:  KP_Henrob [ Fri Aug 02, 2019 7:16 pm ]
Post subject:  Issues with create_boot_project

Hello all,
I'm having an issue where when using create_boot_project in a python script my link to file images will not be exported to the PLCLogic folder. Regardless of whether I put them in there or not before transferring them to my plc they will not show up on the screen where they're supposed to. It works fine when I click the Create boot application button in codesys, however. Here is the code I'm running.
Code:
from __future__ import print_function
if projects.primary:
   projects.primary.close()

proj= projects.open(r"..\..\Display\HMI.project")
app = proj.active_application
app.clean()
app.build()

app.create_boot_application('Application.app', False, True)

system.delay(1000)

proj.close()


I tried making it an online application first, however that brings up the file select dialog that I don't want to appear. It also results in the same issue with the images regardless. The second Boolean option in create_boot_project is supposed to write all the visu files, but it is only doing a few of them.

Any ideas are greatly appreciated. Thank you

Version: 3.4.12.0

Author:  M.Keller [ Tue Aug 06, 2019 7:55 am ]
Post subject:  Re: Issues with create_boot_project

Hi KP_Henrob.

KP_Henrob wrote:
Version: 3.4.12.0

The method create_boot_application() with three parameters was introduced with V3.5 SP3 Patch 10 so your version number does not fit your code. Can you check your version number?

BR
Martin

Author:  KP_Henrob [ Tue Aug 06, 2019 1:03 pm ]
Post subject:  Re: Issues with create_boot_project

M.Keller,
My bad, the version I'm running is 3.5.12.10.

Author:  M.Keller [ Thu Aug 08, 2019 1:47 pm ]
Post subject:  Re: Issues with create_boot_project

Hi KP_Henrob.

KP_Henrob wrote:
I'm having an issue where when using create_boot_project in a python script my link to file images will not be exported to the PLCLogic folder.

What do you mean with "file images"? External File or Image Pool?

KP_Henrob wrote:
Regardless of whether I put them in there or not before transferring them to my plc they will not show up on the screen where they're supposed to. It works fine when I click the Create boot application button in codesys, however.

You mean the images don't show up in your visualization if you create the boot application with Scripting and copy the result to the PLC. Am I right?

BR
Martin

Author:  KP_Henrob [ Thu Aug 08, 2019 4:31 pm ]
Post subject:  Re: Issues with create_boot_project

To the first question, the Image pool images.

To the second question, that is correct.


Update:
I have found a way to get it to work, however it doesn't work well with the script, as it needs to work on any machine.
Under project settings>visualization, if I change the path for image files to an absolute one, it will work. I tried using a relative path, but that does't export the images as they don't show up on the screen of my plc. Is there a way to use a relative path for this?

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