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

Updating device version

pavo
2016-08-26
2017-01-02
  • pavo - 2016-08-26

    Is it possible to update a version of a device/library in the project by Python?

     
  • mkeller - 2016-08-30

    Hi pavo.

    pavo hat geschrieben:
    Is it possible to update a version of a device/library in the project by Python?

    Yes and yes.

    For the update of a device you use the methods of the already existing device object. You need the device ID, the device type, the version and, if required, the module ID of the new device. See .

    For the update of a library you need to find the library manager object and replace the library entry in it. That's the way to do it for managed libraries. For a placeholder you can change the default resolution. See .

    Some libraries are added and managed by other objects in the project. For example the PLC.

    BR
    Martin

     
  • JöLa - 2016-12-16

    Hello!
    Updating a device is clear, but how can i replace/update a library to a defined version (not to newest)?
    A look into the script documentation (3.5.8.0) there is only an and an .
    Using this both methods (first uninstall and then install) all my library parameters in the project are gone (default values).

    Is there a possibility to get the library parameters before uninstalling the old library?
    Is there perhaps a new ScriptEngine 3.5.9.0 with this or interface?

    To set the libraries to the newest version i use the interface ond open the project with the .
    But here i get DragDrop register exceptions dialogs like in the attachment after calling .
    See here http://forum.codesys.com/viewtopic.php?f=18&t=6860&hilit=library+update#p14769

    Regards,
    Jörg

    IMG: DragDrop

     
  • mkeller - 2017-01-02

    Hi Jörg.

    JöLa hat geschrieben:
    Is there a possibility to get the library parameters before uninstalling the old library?

    You can get the list of parameters for a library from the property "parameters" from a library reference which you get from the LibMan object.

    This example code shows the list of existing parameters of the library reference from the LibMan object and also change some for my test library:

    params = library_reference.parameters
       for name in params:
          print "param: %s => %s" % (name, params[name])
          if name.endswith("_SIZE"):
             # set the parameter to new value
             params[name] = "120"
             print "new value of param: %s => %s" % (name, params[name])
    

    JöLa hat geschrieben:
    Is there perhaps a new ScriptEngine 3.5.9.0 with this or interface?

    ILibMananager is not the LibMan object but the library repository manager of CODESYS. Get the LibMan object of your application or use the one of the Pool and remove the old library reference and add a new one with the required version.

    BR
    Martin

     

Log in to post a comment.