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 Wed Nov 13, 2019 8:20 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Wed Jun 19, 2013 7:21 am 
Offline
User avatar

Joined: Mon Jun 06, 2011 8:42 am
Posts: 47
Hi,

I know I have raised this question before, but there might have been some improvements since last time. :)

Is it possible to suppress the dialogs from CoDeSys V2.3, when using Python script to e.g. convert a V2.3 library to a V3.x library?

Previous answer was: (from viewtopic.php?f=18&t=4888)
Quote:
I just queried my coworker responsible for the converter code. The converter internally calls into CoDeSys V2.3 code via COM, and this dialog is shown by that V2.3 code. So it does not use the CoDeSys 3.x MessageService, and thus there is no possibility to catch it from a Python script.


The message I specifically want to suppress is:
Quote:
The project could not be compiled. Syntax adaption of the source code will not be performed!

The reason for this is that my V2.3 and V3.x code are not dependent on the same library, so I do some syntax adaption in the V2.3 code before importing it - therefore, it is not possible for me to get it to compile in V2.3.

Best regards,
Frank


Top
   
PostPosted: Wed Jun 19, 2013 5:30 pm 
Offline
Frequent User
Frequent User
User avatar

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

This issue was officially considered as Requirement 686. It was denied by our product management, because they consider the code adaption a very important part of the conversion functionality.

The following workarounds could be considered:
  • Applying the mentioned modifications in V3, after the import. If those modifications are systematic, and not manually, this can be automated using the following means:
    • IronPython scripting via PLCOpenXML format and the .NET or python XML processing functionalities.
    • Automation Platform API
  • Creating your own "converter" solution which uses COM to extract the ST source as Text from V2.3, generate PLCOpenXML, and import that into V3. (Using the COM functionality from .NET, it may be even possible to perform all that in a semi-automated way via an IronPython script running in CODESYS).

The first way has the advantage that it still preserves the code adaptions.

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

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


Top
   
PostPosted: Thu Jun 20, 2013 7:26 am 
Offline
User avatar

Joined: Mon Jun 06, 2011 8:42 am
Posts: 47
Hi Markus,

Thanks for your answer and the possible workarounds. I will consider which choice to make. For your information I have now tried some of the new script engine functionality in V3.5 SP3 and this helps me a lot. :) The only thing missing before I have set up a complete scripting autobuild now, is the warning dialog from V2.3 Converter. My current workaround is to start CoDeSys with script from command-line and after that I start another program which waits for any dialog to appear with the specific title and then it shuts it down and waits for the CoDeSys process to finish. :lol:

Best regards,
Frank


Top
   
PostPosted: Thu Jun 20, 2013 9:25 am 
Offline
Frequent User
Frequent User
User avatar

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

Just out of curiosity: The issue was first raised in May 2012. Do you really have such a big bunch of projects to convert from V2 to V3, so you're still busy for such a long time?

Thanks,
Markus

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

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


Top
   
PostPosted: Thu Jun 20, 2013 10:45 am 
Offline
User avatar

Joined: Mon Jun 06, 2011 8:42 am
Posts: 47
Hi Markus,

No. I do know have that many projects to convert. However, in my company we develop software that supports multiple HW platforms and some has 2.3 runtime and some has 3.x runtime.

What we do is that we primarily develop for 2.3 since this has the largest customer base and then our continuous integration build server automatically converts the 2.3 source code into 3.x before building the binaries for 3.x runtime. Then only a few pieces of the source code has to be actually saved in version control system as V3.x.

The reason for me to bring up the issue again, was that I am currently working on improvements of the build system. I do not work full-time with that. :)

Best regards,
Frank


Top
   
PostPosted: Fri Jun 21, 2013 2:18 pm 
Offline
Frequent User
Frequent User
User avatar

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

In that scenario, disabling the automatic conversions done by the codesys converter seems contra productive to me. Especially, as you start with an existing V2.3 project without compile errors.

In your case, I really think the best solution is to use the converter on the unmodified V2.3 project, and then apply your custom modifications using scripting and PLCOpenXML afterwards.

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: Fri Jun 21, 2013 2:44 pm 
Offline
User avatar

Joined: Mon Jun 06, 2011 8:42 am
Posts: 47
Hi Markus,

The V2.3 projects are not without compile errors even before syntax conversion. The V2.3 projects are libraries that are supposed to be included in larger projects. First after being included in that project, they can compile in V2.3.

So if I want to avoid the Converter dialog, then I really only see two rather large tasks. Either modify the way our entire code base is assembled so libraries can compile by themselves or write our own converter and skip using built-in V2.3 to 3.0 Converter.

For now I will stick with the work-around even though it is quite a "hack". :)

If I cannot get this work-around to be reasonable stable, then I think I will go for writing my own converter from V2.3 to PLCOpenXML. I have had that in mind almost from the beginning of creating the system, but thought that there must be a way around the dialog since it is only a warning. Now that 3-S has decided not to implement that, I see this as kind of the last way around. Even though the decision not to allow script access to that particular dialog because syntax adaption is important seems a little self-contradictory, when using the converter manually then it is only a warning. If the syntax adaption was really that important, then I guess you should not allow import without syntax adaption manually either.

Best regards,
Frank


Top
   
PostPosted: Fri Jun 21, 2013 3:20 pm 
Offline
Frequent User
Frequent User
User avatar

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

Quote:
Even though the decision not to allow script access to that particular dialog because syntax adaption is important seems a little self-contradictory


I just feel a need to clarify: Script access to that dialog is not explicitly prevented by us. It is just a negative side-effect of the fact that this dialog is directly raised from the V2.3 code which is internally used by the converter, and not via the normal CODESYS V3 infrastructure.

Additionally, the fact that libraries exist in V2.3 which won't compile, but are still correct in the sense that they're usable from a project was not known to me (nor mentioned by you up to now) - until now, I was under the impression that it is your pre-conversion modifications which break the compilation. (I'm not a V2.3 expert, though...)

Considering those new facts, this seems like a valid use case, and I'll re-raise the issue internally.

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: Fri Jun 21, 2013 4:41 pm 
Offline
User avatar

Joined: Mon Jun 06, 2011 8:42 am
Posts: 47
Hi Markus,

Thanks for raising the issue again. :)

However, I do not agree that the description of the use case is new. I described the use case on May 3, 2012, when we discussed it the first time. See post 5 in viewtopic.php?f=18&t=4888. Comparing with my description in this thread I think it is quite similar.

Description from old thread:
Quote:
The code is not able to compile by itself in V2.3 since it is a library, that needs to be included in a larger project before it is able to compile; that is why the code will not be able to compile in V2.3. Furthermore, I need to do some custom conversions that are very specific at my company because V2.3 and V3 code is not supposed to run on the same hardware platform.

Description in this thread:
Quote:
The reason for this is that my V2.3 and V3.x code are not dependent on the same library, so I do some syntax adaption in the V2.3 code before importing it - therefore, it is not possible for me to get it to compile in V2.3.
...
The V2.3 projects are not without compile errors even before syntax conversion. The V2.3 projects are libraries that are supposed to be included in larger projects. First after being included in that project, they can compile in V2.3.


We discussed quite some back and forth at that time, so the point might have gotten lost at the time.

Best regards,
Frank


Top
   
PostPosted: Mon Jul 01, 2013 7:53 am 
Offline
Frequent User
Frequent User
User avatar

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

Sorry for the long delay, I've been out of office last week.

Yes, I have to admit, that point got lost.

The Requirement entry in our Jira Database does indeed not contain the fact that those are libraries which don't compile despite being "correct", neither the fact that this is a regular process instead of an one-time migration issue.

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 Jul 17, 2013 7:54 am 
Offline
Frequent User
Frequent User
User avatar

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

This issue was now again discussed internally.

I got the following arguments from my coworkers:

In most cases, those libraries don't compile because they access global variables from the project. (In V2.3, everything is in the same global namespace.)

The solution in this case is to define appropriate constants within the library (which also serve as default values). When the library is referenced from within the project, the values from the project will shadow the values from the library, so it should work fine as before.

Having non-compiling Libraries in V2.3 is considered "bad style", and V2.3 usually warns each time when you save such a library.

In V3, this mechanism of shadowing will not work the same way, so if you convert a non-compilable library to V3, it still will be non-compilable in V3, and thus useless (at least without further modifications).


As I said, I myself am not a V2.3 expert, so I just have to accept their arguments.

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 Jul 17, 2013 8:20 am 
Offline
User avatar

Joined: Mon Jun 06, 2011 8:42 am
Posts: 47
Hi Markus,

Thanks for considering the issue again and posting the response from your coworker.

I will bring the issue up in my department again and then we can find a solution that works for us.

Best regards,
Frank


Top
   
PostPosted: Wed Jul 17, 2013 9:02 am 
Offline
Frequent User
Frequent User
User avatar

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

Feel free to contact me with email or via our support department to discuss more details if necessary.

HTH,
Markus

_________________
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  [ 13 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