CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Dec 16, 2018 7:30 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Sep 21, 2015 4:32 pm 
Offline

Joined: Fri Jul 10, 2015 12:05 am
Posts: 2
Is there a way to automate the creation of .package files using Python in CodeSys? If so, could you give an example and/or point me to documentation about it? Thank you.


Top
   
PostPosted: Thu Sep 24, 2015 10:13 am 
Offline
Frequent User
Frequent User
User avatar

Joined: Fri Mar 18, 2011 4:12 pm
Posts: 266
Hi,

cgage@opto22.com wrote:
Is there a way to automate the creation of .package files using Python in CodeSys? If so, could you give an example and/or point me to documentation about it?


Currently, there is no dedicated Scripting API for package creation.

However, the CODESYS packages are just Zip files with a manifest file in XML.

So you could use our Package Designer to manually create a "template" package, unzip it, and then use standard XML and Zip APIs in the Script to create the packages.

Our own buildservers build the packages the same way - they collect the artifacts from the build directories and the source repository (including the mainifest file), and zip it together to create the package. Small adaptions like setting the version number in the manifest are performed by the build scripts during that process.

The Package Designer is available in our store for free download, and it has online help explaining all the options and settings. If you want to go the hard way and manipulate the XML yourself, we have some documentation for the XML format available - it is part of the Automation Platform SDK (Packages.pdf in the Documentation subdirectory), or you can request the "OEM Specification: Packages" it via support@codesys.com.

HTH,
Markus

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

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


Last edited by M.Schaber on Fri Sep 25, 2015 7:28 am, edited 2 times in total.

Top
   
PostPosted: Thu Sep 24, 2015 6:57 pm 
Offline

Joined: Fri Jul 10, 2015 12:05 am
Posts: 2
Hi Markus,

Thank you very much for the information, it is precisely what I needed to know.


Top
   
PostPosted: Fri Nov 09, 2018 3:16 pm 
Offline

Joined: Wed Mar 01, 2017 3:07 pm
Posts: 8
M.Schaber wrote:
Hi,

cgage@opto22.com wrote:
Is there a way to automate the creation of .package files using Python in CodeSys? If so, could you give an example and/or point me to documentation about it?


Currently, there is no dedicated Scripting API for package creation.

However, the CODESYS packages are just Zip files with a manifest file in XML.

So you could use our Package Designer to manually create a "template" package, unzip it, and then use standard XML and Zip APIs in the Script to create the packages.



Hi, I was trying to unzip the package and zip it again. As a result, the package became a .zip file. How can I turn it into a .package file again? I have tried to rename it directly by putting .package instead of .zip. When installing it, error occurred. it said "Invalid package. The manifest could not be found". What is the problem? I want to use the script to include the libraries and device description file.

Best regards
Chen He


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 1 guest


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