Updating project archives

etamgul
2015-07-27
2015-07-28
  • etamgul - 2015-07-27

    Hi

    I have a set of project archives, but with time they get outdated so I currently use a script to iterate and update the device version,
    basically opening the project archive, device.update(version) and saving the project as archive.

    This sort of works but I also would like to update the compiler version to the newest, if possible.
    When I open the archive with codesys GUI it asks me if I want to use the latest or older ones, but I don't
    get a message when the script is executed.

    Is it even possible? If so which interface should I use?

    Thanks

     
  • mkeller - 2015-07-27

    Hi etamgul.

    Right now, this is not yet possible, but this improvement is already listed in our Jira tracker CDS-34105, so it will be implemented eventually.

    BR
    Martin

     
  • etamgul - 2015-07-28

    Hi

    Thanks for the answer, is there any chance to do it semi-automated?
    I'm thinking on a solution to open the project archives by script, do the managable changes, then ask the user to finish the settings
    and save, close. My script then would wait till projects.all gets empty (none project is open) and would reopen the user saves project file
    and export or save it as project archive.

    So something similar:

    Β proj = projects.open_archive(...)
    Β  Β # do some automated changes
    Β  Β notify_usr_to_do_manual_changes()
    Β  Β while len(projects.all)>0:
    Β  Β  Β system.delay() # this currently blocks my access to GUI, is there an async function to somehow put the script in background and let the user to access the GUI?
    Β #usr saved and closed everything > reopen the project to export it as archive
    Β proj = projects.open(temp.project)
    Β proj.save_archive(proj_name.archive)
    
     
  • mkeller - 2015-07-28

    Hi

    You could use one of the methods from system.ui to show a message box. For example:

    system.ui.info("Please update ...")
    

    You can also open the "Project Environment" dialog with:

    system.commands[("project", "checkavailableversions")].execute()
    

    I forgot to ask if you use the CODESYS Test Manager. The Test Manager supports the update of the compiler version, library version and the visu profile.

    BR
    Martin

     
  • etamgul - 2015-07-28

    Thank you I was experimenting with this when I found your answer,
    that what exactly what I was looking for.
    Thanks again!

     

Log in to post a comment.