1. Overview
The Device module is responsible for all communication between FrameworX and field devices (PLCs, sensors, supervisory systems, among others).
This communication is handled by protocol drivers, which implement the specifications of each market protocol (Modbus, OPC UA, Siemens, etc.).
The Device module provides the standardized layer where these drivers run, ensuring consistent behavior in terms of initialization, execution, and diagnostics.
...
2. Operating Structure
2.1 Module Initialization
At startup:
- The Device module identifies the configured communication drivers.
- Communication groups are created, taking into account:
- Operand type (bits, words, registers, blocks, etc.).
- AccessType (Read or Write).
- Scan intervals (configured polling time).
- Limits of operand size and quantity supported by the protocol.
This grouping optimizes performance, reduces communication overhead, and ensures protocol compliance.
...
2.2 Communication Triggers
After initialization, group execution depends on communication triggers:
...
The trigger type and operation (read/write) are defined by the AccessType parameter.
...
2.3 Event Queue and Threads
When a trigger is fired:
- The event is placed in the Device execution queue.
- The module has a central thread that scans this queue every 20 ms.
- Each event is allocated to an independent execution thread, allowing parallel and isolated communication.
...
- Low response latency.
- Fault isolation (an error in one group does not block others).
- Better use of multicore resources.
...
2.4 Communication Execution
Within the execution thread:
...
The entire cycle is handled asynchronously and safely within the thread.
...
3. Responsibilities of the Device Module
The Device module acts as the orchestrator of communication, with the following responsibilities:
- Manage configured protocols.
- Create communication groups during initialization.
- Define execution triggers (time/event) based on AccessType.
- Schedule independent threads to perform communication.
- Provide data to drivers (tag values in case of write).
- Receive and store data returned by drivers (in case of read).
- Perform continuous diagnostics, including:
- Communication status (success/failure).
- Execution Time: time taken by each thread.
- Cycle Time: interval between two consecutive executions of the same group.
...
4. Diagnostics and Monitoring
The Device module provides a set of essential diagnostics for reliability:
...
These diagnostics can be accessed for performance analysis, troubleshooting, and configuration optimization.
...
5. Architecture Benefits
- Standardization: consistent logic regardless of protocol.
- Scalability: multiple threads allow handling hundreds of groups simultaneously.
- Efficiency: intelligent grouping reduces communication overhead.
- Robustness: isolated failures do not compromise the system.
- Comprehensive diagnostics: facilitates predictive and preventive maintenance.
...