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

Add device to the device repository

chab
2012-06-13
2015-03-30
  • Anonymous - 2012-06-13

    Originally created by: M.Schaber

    Hi, Edwin,

    Edwin hat geschrieben:
    Is it possible to install devices (into the Device Repository) via a python script?
    In another topic (http://forum-en.3s-software.com/viewtopic.php?f=18&t=1923&hilit=Install+library+in+V3), I saw:

    for repo in librarymanager.repositories:
    ...
    

    Is there something like a devicemanager.repositories?

    Currently, this is not possible yet. It's on our list of planned features, however.

    For now, there is a workaround: You can manually create a project archive containing the device, and then when the script extracts the project archive, the device should be installed automatically.

    HTH,
    Markus

     
  • chab - 2012-06-15

    Thank you, Markus.

    I found another work-around: manipulate the Device Repository directly.
    At least for devices that are specified in *.devdesc.xml files.

    At the location C:\Documents and Settings\All Users\Application Data\CoDeSys\Devices:
    Copy *.devdesc.xml to the proper folder .\<type>\<id>\<version>\device.xml
    Delete .\devicecache.xml
    Re-start CoDeSys
    Now the new device is available.</version></id></type>

    For devices that are specified in .eds files, I did not find an automation option.
    (The conversion from
    .eds file to *.devdesc.xml file is the bottelneck.)
    I'll install these devices manually via the CoDeSys GUI.

    Regards,
    Edwin.

     
  • Anonymous - 2012-06-15

    Originally created by: M.Schaber

    Hi, Edwin,

    Edwin hat geschrieben:
    I found another work-around: manipulate the Device Repository directly.

    I have to advise against this way to work around

    It is not guaranteed to be backwards compatible with future versions of CoDeSys.

    Maybe a lower risky way would be to manipulate the project archive by adding the device descriptions there. But that also only works with devdesc.xml files.

    Markus

     
  • chab - 2012-06-22

    I'll keep it mind.
    Thank you for the warning.

     
  • Frank Jepsen - 2012-09-14

    M.Schaber hat geschrieben:
    ...
    Maybe a lower risky way would be to manipulate the project archive by adding the device descriptions there. But that also only works with devdesc.xml files.
    ...

    Hi,

    I am interested in this feature also, but I am not sure how you want to do the work-around with project archive. I can see that the project archive is in fact just a zip file, so would your "unofficial" advise be to change the device description zip file inside the project archive zip file? Or do you have a more nice way to manipulate the project archive?

    Regards,
    Frank

     
  • Anonymous - 2012-09-17

    Originally created by: M.Schaber

    Hi, Frank,
    Hi, Edwin,

    Up-front: There exists CDS-23707

    Frank Jepsen hat geschrieben:
    ...
    I am interested in this feature also, but I am not sure how you want to do the work-around with project archive. I can see that the project archive is in fact just a zip file, so would your "unofficial" advise be to change the device description zip file inside the project archive zip file? Or do you have a more nice way to manipulate the project archive?

    The official way is to just create a project archive of a project which contains all the devices whose descriptions you want to add.

    "Inofficially", you may also succeed by just modifying an existing project archive and add all the device descriptions you need. I did not yet try this myself, however.

    HTH,
    Markus

     
  • Enchillada - 2015-03-30

    Hi all,
    there is a solution for that issue - not with python but able to automate complete.

    Check the CODESYS installation directory, in folder "Common" there is a file called "RepTool.exe".
    This is very powerful and helped me to install / remove devices from the repository.

    Just call it from command line with argument "/help" and you get lots of options.

    May it will help you guys.

    Regards

    JΓΆrg

     

Log in to post a comment.