Developer Community Documentation Log in to Edit

Admin codesys.com aliazzz i-campbell
There is a newer version of this page. You can find it here.

Community

This documentation is open to be edited by all CODESYS Forge developers. It can be used to share global information, which is of interest for developers of differnt projects.

  • Software hints
  • Workflows
  • Tutorials
  • Coding tips, - standards or - styles
  • ...

Recommended Software

CODESYS programming

Use the CODESYS programming system in the latest version. It's use is completely free.

You can the program every CODESYS programmable PLC with it, or use the 2h Demo of one of the SL runtimes:

  • CODESYS Control Win V3
  • CODESYS Control for Raspberry Pi SL
  • CODESYS Control for Linux SL

The demos are running 2h and can be restarted as often as you want.

Version Control System

You should use SVN when you want to have a good version control system with CODESYS projects, and if you want to publish them on CODESYS Forge.

CODESYS SVN can be freely used with CODESYS Forge. But we reconnend to use the tool cforge, as it improves the workflow with CODESYS Forge pretty much.

Versioning

Project versions

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.

Offcourse there are some known exceptions;
* ;
* ;
* etc

Versioning of own items

The following version scheme suggestion is empirically in nature;

v0.0.0.1    Initial version: Your first library / project in beta stage

whenever you bugfix, just count up..

 v0.0.0.2    Bugfixes/coding version 2
 v0.0.0.49   Bugfixes/coding version 49

whenever you have tested a complete stable internal version

 v0.0.1.0    your first stable version (tested)
 v0.0.1.3    your first stable version (tested) with some bugfixes

 v0.0.2.0    your second stable version (tested)
 v0.0.3.11   your third stable version (tested) with more bugfixes

whenever you have software which you have tested externally (public beta)

 v0.1.0.0    your first public beta version (tested/ publicly released)
 v0.1.0.2    your first public beta version (tested/ publicly released) with some bug fixes

 v0.2.0.0    your second public beta version (tested/ publicly released)

Whenever you have a stable public aplha release;

 v1.0.0.0    Your first alpha released version
 v1.0.0.6    Your first alpha released version with some bugfixes
 v1.1.0.9    An alpha released version with a beta tested/released component and some bugfixes

offcourse other release scheme's are possible (examples)

Coding tips

  • when using RTS_IEC_HANDLE and RTS_IEC_RESULT types, please 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 to it);
  • for modern coding style advice: read the Codesys v3 library development tips as provided in CODESYS help,
    The tips and practices laid out in the codesys help are pretty complete but not as thorough as "code complete", though they provide a very good starting point.
    Further reading: e.g. Steve McConnell "Code Complete";