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 Tue Dec 11, 2018 12:55 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Codesys Forge FAQ
PostPosted: Fri Sep 21, 2018 12:59 pm 
Offline
User avatar

Joined: Fri Feb 10, 2017 6:12 am
Posts: 56
Which version of the Codesys IDE is the base for all projects (10.x, 11.x, 12.x or 13.x)? It seems to me that it is important to specify. Otherwise, users will not be able to open projects.


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Fri Sep 21, 2018 2:54 pm 
Offline

Joined: Mon Dec 13, 2010 3:02 pm
Posts: 44
OK, didn't think about that rule, yet. I would expect no problems, as long as the users of the project have the most current version.

But you are right, that libraries should always be stored with a specific project format when working with multiple people on it.

Is that OK for you, if I document it Like that? Or did I get you wrong?

BR,
Ingo

Gesendet von meinem LG-H870 mit Tapatalk


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Fri Sep 21, 2018 6:49 pm 
Offline
User avatar

Joined: Fri Feb 10, 2017 6:12 am
Posts: 56
I think that all developers should stick to one version of the development environment to avoid any confusion (not only for libraries). Users can use any version.
In any case before download user must know project (library) format. This format must be one for target device (RPi3, ...).


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 11:40 am 
Offline
User avatar

Joined: Fri Jan 19, 2018 3:38 pm
Posts: 56
As long as the used compiler version is mentioned in a project/lib, there should not be any issues for users as they know they will need to upgrade or not.
Personally, I always use the newest available runtime in a library/project, as version freezing is not wise from a from security/bug fixes standpoint.
Offcourse this approach has also got some downsides.

So, specifying which current version is used will help the users.

_________________
https://github.com/Aliazzzz


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 12:12 pm 
Offline
User avatar

Joined: Fri Feb 10, 2017 6:12 am
Posts: 56
"used compiler version" and project file format are different things. You can use 3.5.10.0 version for compiler but 3.5.11.0 version for the project file format. I'm also suggest to choose minimal compiler version too.
If you have an old working project for 3.5.10.0, then, I think, you will not rework it for each new Codesys IDE. Because it is dangerous.
If you have Codesys 3.5.10.x you can't open 3.5.11.x (3.5.12.x, 3.5.13.x) projects. You must install new Codesys version, open project and save it as 3.5.10.x.

I have experience developing libraries and projects as SDK. Support is difficult, if you do not use one format type.


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 12:31 pm 
Offline
User avatar

Joined: Fri Jan 19, 2018 3:38 pm
Posts: 56
Never too old to learn something new, as I did not realise this...
In my experience, a .package in which all components are tuned to each other has proven a good way to deploy software to third parties.
This offcourse is a different way alltogether.
Ergo, we as developers can help to alleviate each other (and users) by sticking to some simple good practice points with regards to versioning.
Keep in mind that these guidelines are not dogma's! Sticking by them helps mainly others, but if someone deviates from them its not a deal-breaker.
Could you please bullet-point your good practices here? This so we can comment on them and slowly reach to some guidelines for cforge.

_________________
https://github.com/Aliazzzz


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 2:20 pm 
Offline
User avatar

Joined: Fri Feb 10, 2017 6:12 am
Posts: 56
Visualization Profile version important too.

Also few things:
- for RTS_IEC_HANDLE and RTS_IEC_RESULT types need to add SysTypes2 Interfaces (3.5.4.0);
- if possible, use standard error codes (CmpErrors or CmpErrors2 Interfaces);
- do not use dynamic memory (you can use it if you really need it);
- use the ST language if possible;
- for ST use the modern coding style (Steve McConnell "Code Complete");
- document the source code (more comments);


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 4:41 pm 
Offline
User avatar

Joined: Fri Jan 19, 2018 3:38 pm
Posts: 56
Hi there,

Good contributions, but not exactly what I expected.
How about the versioning tips/bullits? We should start with crawling before we run ;-)

Suggestion;
We can start a WIKI in cforge called "Developer guide & tips" which can contain a compendium of good practices like versioning tips, coding style tips etc etc.


Versioning tips;
-All developers should stick to one version of the development environment to avoid any confusion (not only for libraries). Offcourse, users can use any version.
In any case, the user must know project (library) format before download. This format must be one for target device (RPi3, ...).
- "used compiler version" and "project file format" are different things. You can e.g. use 3.5.10.0 version as compiler but e.g. 3.5.11.0 version for the project file format.
- As long as your project is not finished, stick to the chosen version of compiler and project format;
- ;
etc.

Coding tips;
- for RTS_IEC_HANDLE and RTS_IEC_RESULT types need to add SysTypes2 Interfaces (3.5.4.0);
- if possible, use standard error codes (CmpErrors or CmpErrors2 Interfaces);
- avoid using dynamic memory (the usage of __NEW operator);
- use the ST language whenever possible (ST is by far the most versatile language, in which all operations, manipulations and functions are possible);
- document the source code (add meaningful comments);
- for modern coding style advice: read the Codesys v3 library development tips as provided in codesys help - guidelines for creating libraries,
They are pretty good but, but not as thorough as "code complete" but provide a very good starting point.
Further reading: e.g. Steve McConnell "Code Complete";
-;
etc.

_________________
https://github.com/Aliazzzz


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 5:13 pm 
Offline
User avatar

Joined: Fri Feb 10, 2017 6:12 am
Posts: 56
It's hard to show which version and when to use. For example, if you use object-oriented programming (OOP), I recommend 3.5.10.0 or higher version for the compiler. This is because since this version, something related to properties has changed significantly.
In general, it all depends on the version of runtime available for a specific target platform.


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 6:02 pm 
Offline
User avatar

Joined: Fri Jan 19, 2018 3:38 pm
Posts: 56
Quote:
For example, if you use object-oriented programming (OOP), I recommend 3.5.10.0 or higher version for the compiler. This is because since this version, something related to properties has changed significantly.


* The general recommendation should be to pick the newest available version in which the target can programmed, simply because of security and bugfixes.

_________________
https://github.com/Aliazzzz


Top
   
 Post subject: Re: Codesys Forge FAQ
PostPosted: Sat Sep 22, 2018 7:23 pm 
Offline

Joined: Mon Dec 13, 2010 3:02 pm
Posts: 44
Very nice guys! Thanks for all this input.

I know that all this is very difficult, as so many versions, which can be configured in CODESYS, can play a role in the experience everyone of us made once.

But if you reflect, most of it is only a problem in an actual project, or when upgrading it.

When it comes to library compatibility, the rule is really as easy as that:

"The CODESYS version of the user should be greater or equal to the format of the library."

Things like the Compiler Version, Visu Profile, etc. will usually be used from the final project, not from the library. I wrote "usually" as I have exceptions in mind, which count for compiled libs.

But I think, that if we avoid compiled libs, this easy rule will apply (until you prove me wrong ;) ).

BTW: The idea to add a crowd sourced documentation section sounds great! I'll think about it.
And if you have more ideas, or you find bugs, you can also add a ticket to the forge support tracker:
https://forge.codesys.com/forge/support/

Cheers,
Ingo

Gesendet von meinem LG-H870 mit Tapatalk


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 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