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

Get profile of project before starting python script

pavo
2016-05-09
2016-05-12
  • pavo - 2016-05-09

    Is there any possibility to get/read the profile of a project before we open it with Python?
    We have different projects made with different version of COEDSYS. For the start of a Python script we have to know the profile "--profile="CoDeSys V3.4 SP3 Patch 1" of the project. How can we read the profile of a saved project?
    Thanks pavo

     
  • Anonymous - 2016-05-12

    Originally created by: M.Schaber

    Hi,

    pavo hat geschrieben:
    Is there any possibility to get/read the profile of a project before we open it with Python?
    We have different projects made with different version of COEDSYS. For the start of a Python script we have to know the profile "--profile="CoDeSys V3.4 SP3 Patch 1" of the project. How can we read the profile of a saved project?
    Thanks pavo

    Currently, there's no official way to access the profile information of a project without opening it.

    As we have backwards compatibility features (compiler version settings, storage format etc.), it should be possible to open and process older projects with newer versions.

    If you want to get into the deep waters of unsupported code (which might break with any future version of CODESYS), you could try to parse it out of the project. The project is basically a zip file, and the profile information is included there (in the files profile.auxiliary). In the header of the file, the profile name is also encoded (in UTF-16, AFAICS). So with some reverse engineering, you could write your own code to parse profile name out of the file header...

    HTH,
    Markus

     

Log in to post a comment.