CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Mon May 22, 2017 10:31 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Updating device version
PostPosted: Fri Aug 26, 2016 2:30 pm 
Offline

Joined: Tue Jul 17, 2007 2:45 pm
Posts: 2
Is it possible to update a version of a device/library in the project by Python?


Top
   
PostPosted: Tue Aug 30, 2016 1:30 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 192
Hi pavo.

pavo wrote:
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 update(...) 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 IScriptDeviceObject.

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 IScriptPlaceholderReference.

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

BR
Martin

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Fri Dec 16, 2016 4:07 pm 
Offline

Joined: Thu Dec 08, 2016 8:53 am
Posts: 1
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 install_library() and an uninstall_library().
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 ILibManager.replace() or ILibManager.update()interface?

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

Regards,
Jörg


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Jan 02, 2017 12:37 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 192
Hi Jörg.

JöLa wrote:
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:
Code:
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 wrote:
Is there perhaps a new ScriptEngine 3.5.9.0 with this ILibManager.replace() or ILibManager.update()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

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited