CODESYS Reference
Free reference guide: CODESYS Reference
About CODESYS Reference
The CODESYS Reference is a comprehensive quick-lookup guide for IEC 61131-3 PLC programming, covering Structured Text (ST) syntax including variable declarations, conditional branching, loops, FUNCTION_BLOCK, METHOD, and INTERFACE definitions with ready-to-use code examples.
This reference spans all five IEC 61131-3 programming languages supported by CODESYS: Structured Text, Ladder Diagram (LD), Function Block Diagram (FBD), and Sequential Function Chart (SFC) with action qualifiers and transition conditions, plus standard function blocks like TON, CTU, and R_TRIG.
Beyond basic syntax, the guide covers advanced topics such as POINTER_TO, REFERENCE_TO, dynamic memory allocation with __NEW/__DELETE, STRUCT/ENUM/ARRAY data types, and CODESYS-specific libraries including CAA_SerialCom, CAA_File, Visualization, CmpApp, and OPC-UA server configuration.
Key Features
- Complete Structured Text (ST) syntax reference with IF/CASE/FOR/WHILE examples
- FUNCTION_BLOCK, FUNCTION, METHOD, and INTERFACE definitions with PLC-ready code
- Ladder Diagram (LD) and Function Block Diagram (FBD) programming patterns
- SFC steps, transitions, and action qualifiers (N, S, R, L, D, P, P0)
- Standard function blocks: TON, TOF, TP timers and CTU, CTD, CTUD counters
- Data type reference including STRUCT, ENUM, ARRAY, POINTER_TO, and REFERENCE_TO
- CODESYS library guides for serial communication, file I/O, and OPC-UA setup
- Category-filtered browsing across ST Syntax, LD/FBD, SFC, Standard FB, Data Types, and Libraries
Frequently Asked Questions
What IEC 61131-3 languages does this CODESYS reference cover?
This reference covers all five IEC 61131-3 languages supported by CODESYS: Structured Text (ST) with full syntax examples, Ladder Diagram (LD), Function Block Diagram (FBD), Sequential Function Chart (SFC) including action qualifiers and transitions, and Instruction List concepts where applicable.
How do I look up a specific CODESYS ST syntax like CASE or FUNCTION_BLOCK?
Use the search bar at the top to type any keyword such as "CASE", "FUNCTION_BLOCK", or "POINTER". The reference instantly filters entries to show matching syntax with descriptions and copy-ready code examples. You can also browse by category like ST Syntax, SFC, or Data Types.
Does the reference include CODESYS-specific libraries and features?
Yes. In addition to standard IEC 61131-3 constructs, the reference covers CODESYS-specific libraries such as CAA_SerialCom for serial communication, CAA_File for file system access, the built-in Visualization system for HMI, the CmpApp runtime library, and OPC-UA server configuration using symbol attributes.
Can I find SFC action qualifier details in this reference?
Absolutely. The SFC section covers step definitions, transition conditions (simple and complex), and all standard action qualifiers including N (Non-stored), S (Set), R (Reset), L (time Limited), D (time Delayed), P (Pulse), and P0 (pulse on step deactivation), each with practical usage examples.
What standard function blocks are documented here?
The reference includes the most commonly used IEC 61131-3 standard function blocks: TON (on-delay timer), TOF (off-delay timer), TP (pulse timer), CTU (up counter), CTD (down counter), CTUD (bidirectional counter), and R_TRIG/F_TRIG edge detection blocks, all with instantiation and usage examples.
Is this reference suitable for learning CODESYS from scratch?
This reference is designed as a quick-lookup tool for programmers who are actively writing PLC code. While beginners will find the organized syntax examples and clear descriptions helpful for learning, it works best as a companion reference during development rather than a step-by-step tutorial.
Does the CODESYS reference cover data types and memory management?
Yes. The Data Types section covers STRUCT, UNION, ENUM, multi-dimensional ARRAY, POINTER_TO, and REFERENCE_TO with dereferencing examples. It also documents dynamic memory allocation using __NEW and __DELETE for advanced PLC programming scenarios.
Is the CODESYS Reference free and does it work offline?
The CODESYS Reference is completely free with no registration or download required. All content loads in your browser and processes client-side, so once the page is loaded it works without an active internet connection. It supports dark mode and is fully responsive on any device.