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 Fri Dec 06, 2019 2:29 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Mar 18, 2016 4:16 pm 
Offline

Joined: Wed Jan 27, 2016 10:38 am
Posts: 4
Hi all ,

I am trying to build a Container library using python script with the individual library packages having the "Publish all IEC symbols ..." Property-Option set. But I could not find a method or property in the Python API using which I can check this Checkbox. Any assistance to this Problem would be really helpful. Thanks in advance.



Regards,

SK


Top
   
PostPosted: Fri Mar 18, 2016 4:55 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 255
Hi codesyssk.

codesyssk wrote:
I am trying to build a Container library using python script with the individual library packages having the "Publish all IEC symbols ..." Property-Option set. But I could not find a method or property in the Python API using which I can check this Checkbox. Any assistance to this Problem would be really helpful. Thanks in advance.

The property publish_symbols_in_container of the IScriptLibraryReference can be used to access the "Publish all IEC symbols ...".

An example which prints the libraries in the project:
Code:
def getFullName(obj):
   str = ""
   while obj is not None and not obj.is_root:
      str = obj.get_name() + str
      obj = obj.parent
   return str


proj = projects.primary

found = proj.find("Library Manager", True)
assert(found is not None and len(found) > 0, "no libman found")

for libMan in found:
   print("Library manager: {}".format(getFullName(libMan)))
   for lib in libMan.references:
      if lib.is_placeholder:
         print("Placeholder: {} => {}".format(lib.name, lib.effective_resolution))
      else:
         print("Lib: {}".format(lib.name))
      print("Publish symbols: {}".format(lib.publish_symbols_in_container))

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: Mon Mar 21, 2016 10:55 am 
Offline

Joined: Wed Jan 27, 2016 10:38 am
Posts: 4
Hi Martin,

Thanks for the assistance :D , it worked without a hitch.

I have two more questions:

1.My Container library is connected to the SVN repository (Project contains -"SVN_VERSION_INFO" object)
During the execution of check_all_pool_objects() I am getting an error: "VAR_GLOBAL not allowed in a Container library".
Is there a Workaround for this ?.

2.After I disconnected the Project from the repository, i was able to compile the library without any errors.
But after I disconnect the Project from the repository can I connect back to an existing repository with URL ?



BR,

SK


Top
   
PostPosted: Mon Mar 21, 2016 3:02 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 255
Hi codesyssk.

codesyssk wrote:
1.My Container library is connected to the SVN repository (Project contains -"SVN_VERSION_INFO" object)
During the execution of check_all_pool_objects() I am getting an error: "VAR_GLOBAL not allowed in a Container library".
Is there a Workaround for this ?.

I talked with my colleague, which is responsible for our libraries and the procedures. A container library should only contain the project information and the library manager. For what reason do you have the VAR_GLOBAL in the container library?

codesyssk wrote:
2.After I disconnected the Project from the repository, i was able to compile the library without any errors.
But after I disconnect the Project from the repository can I connect back to an existing repository with URL ?

You can but do you want to do that to work around the "VAR_GLOBAL not allowed in a Container library"?

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: Mon Mar 21, 2016 3:48 pm 
Offline

Joined: Wed Jan 27, 2016 10:38 am
Posts: 4
Hi Martin,

Thanks again for your quick reply.


1. The VAR_GLOBAL CONSTANT is a part of the SVN_VERSION_INFO and not a direct part of my Container library.


2. How can I connect to an existing repository?. I could not find svn.connect(..) using inspectapi.dir(..) or in F1 help.


BR,

SK


Top
   
PostPosted: Mon Mar 21, 2016 4:22 pm 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 255
Hi SK.

codesyssk wrote:
1. The VAR_GLOBAL CONSTANT is a part of the SVN_VERSION_INFO and not a direct part of my Container library.

I think nobody checked if the Subversion Integration works for container libraries.

codesyssk wrote:
2. How can I connect to an existing repository?. I could not find svn.connect(..) using inspectapi.dir(..) or in F1 help.

Sorry, I forgot to check if there is a Scripting API for it.

At the moment you can only use the following workaround:
Code:
system.commands["svn", "connect"].execute("svn://project/destination/url", "HEAD", "false")

The parameters are:
  1. Absolute URI to the project in the Subversion repository
  2. Revision: HEAD or a numeric revision as string
  3. Omit externals: Boolean

The improvement to add the necessary API is already listed in our Jira tracker SVN-243, so it will be implemented eventually.

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: Tue Mar 29, 2016 8:22 am 
Offline
Frequent User
Frequent User
User avatar

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

codesyssk wrote:
1.My Container library is connected to the SVN repository (Project contains -"SVN_VERSION_INFO" object)
During the execution of check_all_pool_objects() I am getting an error: "VAR_GLOBAL not allowed in a Container library".
Is there a Workaround for this ?.


Our build server first executes an svn disconnect on the project before it further processes and then saves the project as library / compiled library - this shadows the problem in our house.

Disconnecting the project before publishing it generally makes sense as one should not publish the library to customers when it still contains the SVN working copy information. (The information is generally useless to the user, may introduce a slight information leak, and just bloats the library.)

However, we already introduced a special casing code which recognizes interface libraries and disables the SVN_VERSION_INFO language model, so I filed SVN-355, so the problem will be fixed eventually.

HTH,
Markus

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

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


Top
   
PostPosted: Wed Mar 30, 2016 3:13 pm 
Offline

Joined: Wed Jan 27, 2016 10:38 am
Posts: 4
Hello Martin and Markus,

The Workaround for the svn connect was exactly what i needed. Thanks a lot.

Thanks for the update on the svn issue with Container library.

Best Regards,

SK


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 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