CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Codesys Forge FAQ
https://forum.codesys.com/viewtopic.php?f=21&t=9151
Page 1 of 1

Author:  Viacheslav Mezentsev [ Fri Sep 21, 2018 12:59 pm ]
Post subject:  Codesys Forge FAQ

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.

Author:  Ingo Hornberger [ Fri Sep 21, 2018 2:54 pm ]
Post subject:  Re: Codesys Forge FAQ

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

Author:  Viacheslav Mezentsev [ Fri Sep 21, 2018 6:49 pm ]
Post subject:  Re: Codesys Forge FAQ

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, ...).

Author:  Aliazzz [ Sat Sep 22, 2018 11:40 am ]
Post subject:  Re: Codesys Forge FAQ

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.

Author:  Viacheslav Mezentsev [ Sat Sep 22, 2018 12:12 pm ]
Post subject:  Re: Codesys Forge FAQ

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

Author:  Aliazzz [ Sat Sep 22, 2018 12:31 pm ]
Post subject:  Re: Codesys Forge FAQ

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.

Author:  Viacheslav Mezentsev [ Sat Sep 22, 2018 2:20 pm ]
Post subject:  Re: Codesys Forge FAQ

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);

Author:  Aliazzz [ Sat Sep 22, 2018 4:41 pm ]
Post subject:  Re: Codesys Forge FAQ

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.

Author:  Viacheslav Mezentsev [ Sat Sep 22, 2018 5:13 pm ]
Post subject:  Re: Codesys Forge FAQ

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.

Author:  Aliazzz [ Sat Sep 22, 2018 6:02 pm ]
Post subject:  Re: Codesys Forge FAQ

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.

Author:  Ingo Hornberger [ Sat Sep 22, 2018 7:23 pm ]
Post subject:  Re: Codesys Forge FAQ

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

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/