PLC Programming SAPLC ProgrammingSOUTH AFRICA

brands · South Africa

CODESYS library structure: building, versioning, and

CODESYS libraries are how reusable POUs ship between projects. Building, versioning, and the install workflow. Real menu paths and keystrokes for the IDE.

For CODESYS CODESYS Development System V3.5.

CODESYS libraries are how reusable POUs ship between projects. Building, versioning, and the install workflow. This page is the working engineer's read — what the menu paths actually are in CODESYS Development System V3.5, what the keystrokes do, and the mistakes that bite once the program is on a real CPU. We program Soft-PLC + IEC 61131-3 hardware partners ourselves, daily; we are not a CODESYS sales channel.

Try the simulator →

What this is and when you need it

CODESYS libraries are how reusable POUs ship between projects. Building, versioning, and the install workflow. The walkthrough below is the same sequence we use when teaching this on the simulator. Every step names the exact menu path or keystroke; if a name has changed in your version of CODESYS Development System V3.5, it is called out. The simulator runs the same logic flow without the licence cost — ladder, FBD, and ST in a browser, with a virtual CPU you can download to.

Walkthrough

1. Decide what belongs in a library

Libraries are for code that ships across projects: a Motor_FB used on every line, a generic PID wrapper, a CIP-message helper, a Modbus-TCP master driver. Project-specific code stays in the project. Rule of thumb: if a POU is copied unchanged to a second project, it belongs in a library. CODESYS libraries are first-class citizens — the IDE treats them like packaged dependencies.

2. Create a library project

File > New Project > Library. CODESYS asks for a name (Vendor.MotorControl) and a target version (V3.5 SP19 etc). The new project opens with a single application empty by default. Add POUs (FBs, FCs, structures, enums) under POUs in the Devices tree. Set the library properties (Project > Properties): vendor, version, namespace, placeholder name. The placeholder is what consumer projects use to refer to the library version-independently.

// Library properties
// Vendor: PLC Programming SA
// Title: MotorControl
// Version: 1.0.0.0
// Placeholder: MotorControl
// Namespace: MotorControl

3. Build the library binary

Project > Save Project & Install Into Library Repository. CODESYS compiles the library and saves it as a .library file in the local Library Repository (default path C:\Users\Public\Documents\CODESYS\Managed Libraries). The library is now available to any project on the same machine via the Library Manager. For team distribution, share the .library file directly or via a shared library repository on a network drive.

4. Reference the library from a consumer project

Open the consumer project. Library Manager (under Application or POUs > Library Manager) > Add Library > pick MotorControl from the repository > select the version. The library's POUs become available as MotorControl.Motor_FB or via the namespace prefix. Multiple library versions can coexist — V1.0 and V2.0 of the same library can both be referenced if the placeholder system is configured.

5. Version and migrate

Bump the library version (Project > Properties > Version) when interface or behaviour changes. SemVer convention: 1.0.0 -> 1.0.1 (bug fix, no interface change), 1.0.1 -> 1.1.0 (new POU added, no break), 1.1.0 -> 2.0.0 (interface break). Consumer projects pin to a specific version unless the placeholder is set to 'newest' — the explicit pin is the safer default for production.

Common mistakes

  • Putting project-specific tags or hard-coded IPs in a library POU — the library becomes useless for any other project and the maintenance burden multiplies
  • Bumping the library minor version when the interface breaks — consumer projects update transparently and runtime behaviour changes silently in production
  • Forgetting to install the library into the repository before referencing it — the consumer project shows missing-library errors and the build fails confusingly
  • Mixing namespace and non-namespace references in one project — CODESYS allows it but the symbol resolution becomes ambiguous and the build occasionally fails

Each of these mistakes shows up in real projects every week. The simulator catches the first three at compile time; the fourth one only surfaces on hardware, which is why we recommend running the cert packs against a real CPU once you have completed the curriculum modules.

How this fits the broader curriculum

CODESYS library structure: building, versioning, and reusing code is one of the building blocks. The full CODESYS curriculum on the simulator covers: programming-language fundamentals (ladder, FBD, ST), tag and variable scope, HMI tag binding, comms setup (Profinet / EtherNet/IP / Modbus depending on the platform), and the brownfield troubleshooting pathway. Each is its own module with worked examples and a portfolio piece. The cert packs at the Pro tier align to the ISA CCST exam content outline. Reference: isa.org.

For the platform-pick decision — when CODESYS is the right call versus a different brand — see the brand hub. For region-specific context on where CODESYS dominates the SA install base, see the relevant city pages under /brands/codesys/training-in-* and the sector pages under /industries.

Where this sits in a working week

A technician who has finished this module typically spends the next three to four working days running the same logic flow on hardware. The simulator's value is the dry run — getting the keystrokes and the IDE conventions into muscle memory before you sit down with a live CPU. The first time you build this on hardware, expect the IO mapping and the addressing conventions to slow you down for a session or two; the simulator's project tree mirrors the same shape so the transition is short.

The full CODESYS curriculum runs roughly 60 to 100 hours of focused practice. That breaks into bit logic and timers in the first 20 hours, FBs and structured data in the next 20, comms and HMI in the next 20, and a portfolio piece in the last block. Pace yourself — three or four hours per session, four sessions a week, and you finish in eight weeks. Most of our learners report that the bottleneck is not understanding the IDE, it is building reflex around the conventions: where CODESYS expects you to put state, how it scopes variables, what naming patterns the OEMs in the sector use.

Vendor reference

CODESYS's own documentation is the canonical reference once you are working on real hardware: CODESYS Online Help. The simulator covers the basics; the vendor docs cover everything specific to a hardware revision, a firmware update, or a CPU-specific quirk. Bookmark both. The IEC 61131-3 standard that governs all the CODESYS programming languages is at iec.ch.

What we don't claim

This site is not SAQA-registered, not MerSETA-accredited, and not an NQF-registered qualification provider. Our completion certificates are course-level only — they describe what you covered, not an NQF Level X qualification. The CCST cert from ISA is the portable industry credential we recommend; we are not an ISA cert delivery partner either, but our cert packs are CCST-aligned. The walkthrough above is brand-specific because CODESYS's tooling has its own conventions; do not assume the same menu paths exist in another brand's IDE.

How to start

You can be running codesys library structure: building, versioning, and reusing code in the simulator in 5 minutes. Free tier covers the basics, no card, no install. Once you are 20 minutes in you will know whether the platform fits how you learn. The full CODESYS curriculum is the Basic tier (USD 12 / month). The cert packs and portfolio export sit in the Pro tier (USD 29 / month). For institutional buyers — TVET colleges, private training providers, in-house engineering training departments — the bulk-licence option is the Teams tier, USD 199 per seat per year, minimum 5 seats. The training-centres page has the institutional pitch and the contact form.

Honest expectations on the local job market

Petrochem, mining, FMCG, automotive, and water-utility sectors all carry CODESYS install bases somewhere in their stack. Knowing the IDE conventions on this page does not get you a job by itself; it gets you past the first technical screen. The portfolio piece — a working program you built yourself, with a wiring track, a tag list, an HMI screen, and a short README explaining the design choices — is what lands the second interview. The simulator's portfolio export bundles all of that into a single folder you can hand a hiring engineer. Recruiters in this space skim the README first; if your design choices are coherent, they read the code.

Load-shedding has reshaped what gets built first in CODESYS programs across SA. Power-recovery patterns — controlled shutdown on UPS hold, state recovery from retentive memory, sequenced restart of motor groups — now belong in the same module as the basics. CODESYS library structure: building, versioning, and reusing code fits into that shape: every line of code you write needs to consider what state the controller is in when it powers up after a 2.5-hour cut, not just what state it is in when running. The simulator's restart-from-cut mode lets you exercise this without bricking real hardware.

Start the free tier →

By PLC Programming SA · Last updated 2026-05-15