CODESYS Platform · 01
CODESYS Engineering: the development environment and languages
Where the project is written, tested and debugged. All six IEC 61131-3 languages, the device configurator and library management sit under a single tree.
Six languages, one project tree
Every language the standard defines is supported and they can be used together. This is less a matter of preference than of readability: when each function is written in the language that expresses it most clearly, the project still makes sense a year later.
- ST — Structured Text The densest form of expression for calculation, algorithms and state machines.
- FBD — Function Block Diagram A structure in which signal flow can be followed visually.
- LD — Ladder Diagram Close to relay logic and familiar to maintenance teams.
- SFC — Sequential Function Chart The natural way to express a step-by-step process.
- CFC — Continuous Function Chart Freely placed blocks and connections.
- IL — Instruction List For low-level, short operations.
Debugging and working online
While the application runs you can watch variables, write values and set breakpoints. The tool that does the real work during commissioning is the built-in trace: it records your chosen variables at cycle resolution.
You rarely find the cause of a motion problem by eye. Plotting following error, torque current and command value on the same time axis usually shows at a glance whether the fault is mechanical or a tuning parameter.
Library structure and versioning
Moving repeated functionality into a library instead of burying it in the project costs a little more on the first machine and pays back from the second onwards. The library is versioned, its interface kept stable, and handed to the machine owner with its source.
The rule we apply at EMEA Technology is simple: anything we write twice in the field goes into a library. Motion control is where this shows most: blocks such as cam generators and sensor correction travel from project to project.
Frequently asked questions about the development environment
Which language should I choose?
There is no single right answer; the nature of the job decides. A sequential process reads well in SFC, mathematical work is shorter in Structured Text, and a maintenance team raised on relay logic will be at home in Ladder. Since you can mix them in one project, choosing per block is the practical route.
How far can I test in simulation?
You can verify the logic flow, state machines, alarm conditions and screen behaviour without any hardware. What simulation does not cover is field timing: real cycle time, drive response and communication latency are only measurable on hardware.
Can a team work on the same project?
Yes. Version-comparison tools show the differences between two revisions block by block. In practice we recommend splitting functionality into versioned libraries, so team members work in their own library rather than colliding in one file.
Can I put the source under version control?
Yes. The project can be exported in text form and tracked with the usual version-control tools. What works best in practice is keeping libraries in separate repositories and binding them into the project by version tag, so there is never any doubt about which release runs on which machine.
Can I watch and change variables while running?
Yes. While the application runs you can watch variables, force individual values and set breakpoints. The tool that does the real work during commissioning is the built-in trace: it records your chosen variables at cycle resolution, so events too fast to see can be examined afterwards.
Does a library update break older projects?
Because the bound version is tagged, older projects keep running against their own release. Breakage only happens if you change a library’s external interface and publish it under the same version number. That is why we treat a stable interface, and a new version number for every change, as a rule.
Is moving a project to another controller easy?
The logic layer moves over directly. What has to be rebuilt is the device configuration, the I/O mapping and any vendor-specific blocks. Writing the project with that separation in mind from the start — keeping hardware-facing code in its own layer — reduces migration to a few hours of work.
How do you keep code quality in check?
Naming conventions, static analysis and review. Static analysis catches a whole class of defects at build time, from unused variables to out-of-range array access. A bug found in the field costs many times what the same bug costs at the desk.
What kind of PC do I need for development?
The development environment runs comfortably on an ordinary work laptop; memory and disk speed matter most. Measuring real-time behaviour is a different matter and needs the target hardware — a cycle measurement taken on a desktop does not carry over to the field.
Can you train our team?
Yes. We run a training programme aimed directly at the development environment, library structure and debugging tools, either in our room in Bursa or at your own site. The content is rearranged to suit the group; details are on the Training Request page.