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

Get/Set project information
https://forum.codesys.com/viewtopic.php?f=18&t=4875
Page 1 of 1

Author:  Frank Jepsen [ Mon Apr 23, 2012 1:07 pm ]
Post subject:  Get/Set project information

Hi,

I am trying to get/set project information using scripts.

I can find the "Project information" object using:
Code:
from __future__ import print_function

# define the printing function
def tree(treeobj, depth=0):
    name = treeobj.get_name(False)
    if name == "Project information":
        print(name)
        print(treeobj.get_children().Count)
       
# start looking in primary project
for obj in projects.primary.get_children():
   tree(obj)


I cannot find information on the object in ScriptEngine.chm. Can anyone help me here? Or is the object with project information simply not supported yet?

// Frank

Author:  M.Schaber [ Mon Apr 23, 2012 1:15 pm ]
Post subject:  Re: Get/Set project information

Hi, Frank,


Frank Jepsen wrote:

I am trying to get/set project information using scripts.

I can find the "Project information" object using:
Code:
(snipped)


I cannot find information on the object in ScriptEngine.chm. Can anyone help me here? Or is the object with project information simply not supported yet?


Currently, this object is not supported yet.

I propose that you file this as a feature request via our support department.

Author:  Frank Jepsen [ Mon Apr 23, 2012 1:22 pm ]
Post subject:  Re: Get/Set project information

Hi M.Schaber,

Ok. Then I will have to make a workaround for now.

I will try to create a feature request for it.

Regards,
Frank

Author:  M.Schaber [ Mon Apr 23, 2012 1:41 pm ]
Post subject:  Re: Get/Set project information

Hi, Frank,

Frank Jepsen wrote:
Ok. Then I will have to make a workaround for now.


Maybe you can utilize the native or PLCOpenXML export/import for that workaround.

HTH,
Markus

Author:  Frank Jepsen [ Mon Apr 23, 2012 2:33 pm ]
Post subject:  Re: Get/Set project information

M.Schaber wrote:
...
Maybe you can utilize the native or PLCOpenXML export/import for that workaround.
...

I have now tried that and cannot get it to work unfortunately.

I tried creating a project with some content and project information, exported it and imported it again. The project information goes into the XML I can see, but I cannot load the project information again; only the other content is loaded. Is this a known issue?

The workaround I hoped for was exporting to PLCOpenXML, edit XML using scripts, and import it again.

Now it seems that I have to resort to my previous "workaround", where I have used an auto-mouse/keyboard-clicker to automatically click around in the GUI. :lol: (even though this it not a very stable solution)

Author:  M.Schaber [ Mon Apr 23, 2012 2:44 pm ]
Post subject:  Re: Get/Set project information

Hi, Frank,

Frank Jepsen wrote:
M.Schaber wrote:
...
Maybe you can utilize the native or PLCOpenXML export/import for that workaround.
...
I tried creating a project with some content and project information, exported it and imported it again. The project information goes into the XML I can see, but I cannot load the project information again; only the other content is loaded. Is this a known issue?


I'm not that deep into the export/import function details so I'm afraid I cannot answer that question. If the same problem appears when importing manually via the menu, maybe the general forum can help you. Or you can always fall back to our support department.

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