Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Unable to import Project Information using PLCopenXML

2012-04-24
2012-05-07
  • Frank Jepsen - 2012-04-24

    Hi,

    I and trying to export project as PLCopenXML and import it again. In that process I loose the project information, even though I can see the information in XML file.

    M.Schaber from scripting forum suggested that someone in this forum might be able to help, since this is a problem both when using script and using GUI. ( l viewtopic.php?f=18&t=4875 l )

    Steps to reproduce:
    1) Open project containing Company, Title, and Version in Project information
    2) Projects -> Export PLCopenXML -> Select all
    3) Verify that Project information is written to XML file
    4) Close current project
    5) New project -> Empty project
    6) Projects -> Import PLCopenXML -> Choose exported file
    7) Verify that Project information of original project is present under Additional information
    8 ) See that Project information object is not created in project after import

    Is this a known issue or maybe it is a general limitation?

    Regards,
    Frank

    EDIT: Forgot to tell that CoDeSys is version 3.5 Patch 3

     
  • Frank Jepsen - 2012-04-30

    No CoDeSys people that has any comments for this one?

     
  • TimvH

    TimvH - 2012-05-04

    It is known that the XML im- export is not as complete as the general im- export.
    If you want to have all information I think you should use this method of im- and export.

     
  • Frank Jepsen - 2012-05-07

    Hi TimvH,

    I tried using export/import also, but using that method I cannot import anything at all. I have attached the files that I used for testing if you want to check them. When I test import function (either native or PLCopenXML) I create an empty project and tries to import either the .export or .xml.

    Best regards,
    Frank

    demo.zip [155.64 KiB]

     
  • TimvH

    TimvH - 2012-05-07

    I also cannot import your files, because I don't have the 3.5 P3 Control Win Device. Please always save your project as project archive.
    When I export your project and import it again, it works (I use 3.5 P4) both with general as XML method.
    With the XML method it creates a new device.
    With the general method it asks you to overwrite the existing device.

    PS, your declaration of the variable is not correct. Change it to e.g.:
    PROGRAM POU
    VAR
    i : INT := 1;
    END_VAR

     
  • Frank Jepsen - 2012-05-07

    I have created a new demo project now, with your correction to the program code. All files are in the attached zip-file - including the project archive, which I also uploaded in the first example.
    This time the example is a library and I have installed V3.5 Patch 4, so there should be no problems loading it.

    As you can see in the screenshots (in the attached file), I still have problems importing the project:
    - When using Project Archive I can import Library Manager, POU, and Project Information objects. (no problems)
    - When using PLCopenXML I can import Library Manager and POU objects. (some problems)
    - When using Import/Export I cannot import because I get an "empty" dialog. (larger problems)

    Could you provide me with the .export and .xml files that works fine for you?

    Regards,
    Frank

    demo2.zip [734.63 KiB]

     
  • TimvH

    TimvH - 2012-05-07

    I am almost sure that the reason it doesn't work is because you haven't selected where it needs to be inserted.
    Please open your empty project and click on your project name (in your case demo2 or Untitled2 in the Devices View).
    After this CoDeSys knows where you want to import the objects to.

    In my case when I don't do this, I also get the same result as you.
    When I select it, it works fine.

     
  • Frank Jepsen - 2012-05-07

    You are right about the empty dialog. Now I get the result you see in the attached screenshot.

    Then how do you import the Project Information object?

    The only way I can do that is by project archive; neither import nor import plcopenxml gives me that object. However, I can see that the information is available in the .export and .xml if I open them using a text editor.

    IMG: screenshot_after_project_import_v2.png

     
  • TimvH

    TimvH - 2012-05-07

    During the import you get a tab with additional information which gives you, amongst others, the project information.
    Most of the time an import is only a partial project. In this case you don't want to overwrite the existing Project Information.
    I can imagine that 3S-Software has decided that the Project Information is only informative, but isn't imported nor does it overwrite the existing information.

    In my opinion this is a logical situation.

     
  • Frank Jepsen - 2012-05-07

    I can see your reasoning TimvH.

    Sadly, I am in the less common situation where I would like to import project information. The reason for that is that I am working on an auto-build environment, where a server creates libraries/projects and puts together code. The project information object is not yet accesible via script engine, but is needed especially to give libraries increasing version number. I was trying to use import function as a work-around. (see original post here: l viewtopic.php?f=18&t=4875 l )

    I guess the best solution for me then is to wait for CDS-28415 (ScriptEngine: Script Interface for Project Information) to be planned and implemented.

    Thanks for your time to clarify this matter.

    Best regards,
    Frank

     

Log in to post a comment.