How eclipse-4diac/4diac-forte works
This project is Eclipse 4diac FORTE – a highly portable runtime environment for executing IEC 61499 control applications. Essentially, it’s a control system runtime written in C++ that has been designed to cater to a multitude of operating systems and hardware targets, especially embedded systems like PLCs.
Project Context and Overall Purpose
• Recognize that FORTE is a runtime engine focused on IEC 61499-based control applications.
• Understand that it is built in C++ for portability and supports many operating systems (e.g., POSIX, VxWorks, Win32, and more) with dedicated architecture and communication modules.
• The system incorporates a range of communication protocols (OPC UA, MQTT, Modbus, and others) and various modules (IEC61131-3, arrowhead, ads, etc.) to support industrial control scenarios.
File Tree
• Top-level directories such as “src”, “modules”, “arch”, “com”, and “core” indicate a layered architecture.
• The “src” folder contains architecture-specific implementations (e.g., posix, win32, vxworks, etc) that abstract OS-specific features like threading, socket handling, and timing.
• The “com” directory and many subdirectories under “modules” cover communication protocols (HTTP, OPC UA, MQTT, Modbus, ROS, etc.) and other integrated services.
• The “core” directory appears to include the runtime’s heart such as event handling, function block execution, device and IO abstraction, and the underlying common infrastructure.
• Additional folders like “tests” and “systemtests” indicate a well-structured test framework for validating different architectural components and integrations.
Main Components
a. Runtime Engine Core
• The central engine responsible for executing IEC 61499 function blocks.
• Includes event handling, function block management, resource management, and execution scheduling.
b. Communication/Interface Layers
• Communication modules under “com” (e.g., HTTP, MQTT, OPC UA, Modbus, Powerlink, etc.) that provide different protocol interfaces.
• Core communication infrastructure inside “core/cominfra” manages data exchange between function blocks or external systems.
c. Device IO and Adapter Abstractions
• The I/O and device abstraction (located within “core/io” and the “modules” subdirectories for ads, i2c_dev, etc.) that enables hardware communication.
d. Platform-Specific Abstractions (Architecture Support)
• The “arch” folder contains implementations for various operating systems/platforms ensuring portability.
• Abstraction (e.g., POSIX, freeRTOS, win32, vxworks) as separate but similar layers that plug into the runtime core.
e. IEC 61131-3 Modules and Additional Function Blocks
• Modules for IEC 61131-3 operations (Arithmetic, Bitwise, Conversion, etc.) provide standardized function block libraries.
f. Extended Modules and Integration Components
• Extra modules (e.g., arrowhead, ads, convert, rt_events, embrick) that integrate specific communication or control capabilities.
g. Build and System Testing Infrastructure
• The existence of extensive “tests”, “systemtests”, and build scripts (CMakeLists, Docker, systemd service definitions) underline the role of automated building, integration, and deployment.
Relationships and Data Flow
• The runtime core dispatches events and runs function blocks and communicates with the communication layer.
• Communication modules (in “com” and “modules”) interact directly with the runtime via standardized adapters, converting control commands into protocol-specific messages.
• I/O layers, device communications, and adapters bridge the gap between the external hardware and the control algorithms.
• Testing modules interact with nearly every layer for validation.
Architectural Patterns and Design Principles
• Layered Architecture: Separate concerns by isolating platform-specific (arch), runtime core, and protocol/adapter modules.
• Adapter/Facade Patterns: Communication interfaces translate between internal messages and external protocols.
• Modularity & Extensibility: Each module (IEC61131-3, arrowhead, ads, etc.) is developed independently, which supports plug-and-play extensibility.
• Dependency Inversion/Abstraction: High-level runtime interacts with abstract IO and communication interfaces defined in the “core” and “modules” directories.
Detailed Steps for the Principal Software Engineer
• Surround it with layers representing the OS abstraction (arch) on one side and the communication modules on the opposite side.
• Branch out additional modules (IEC61131-3, arrowhead, etc.) around these core layers.
• Provide annotations or callouts to note critical design patterns (e.g., adapter usage in com modules) and how the system achieves portability.
• Be as granular as possible in capturing the many components (each directory that corresponds to a key architectural concern should be represented either individually or as part of an aggregated layer).