High level overview

High level overview

The plugin system

The plugin system in the Gateway is designed to provide a flexible and extensible way to interact with the runtime Gateway functionalities. It supports plugins written in both Rust and C, allowing users to publish, subscribe, and process datapoints efficiently. The system is built around a well-defined ABI (Application Binary Interface) that ensures seamless interaction between the runtime Gateway and the plugins.

The runtime plugin system crate gc_plugin_system is responsible for loading and managing plugins. It provides the necessary traits and structures to interact with plugins through the C ABI.

The datapoints system

The Datapoint system in the Gateway is designed to handle the communication of data between the runtime Gateway and its plugins. It provides a structured way to manage and transfer data values, ensuring consistency and reliability. The system revolves around two main components: Datapoints and DatapointValues.

Datapoints

A Datapoint is a static structure that serves as a container for DatapointValues. It can be seen as a message that holds a value, timestamp, and quality. Each Datapoint is uniquely identified and can be used across the C ABI boundary, making it suitable for both Rust and C plugins.

DatapointValues

A DatapointValue represents the actual data being communicated. It includes the following fields:

  • Type: The type of the value (e.g., integer, float, boolean).
  • Value: The actual data value.
  • Timestamp: The time at which the value was recorded.
  • Datapoint ID: A unique identifier for the datapoint.
  • Quality: The quality of the data value.

The DatapointValue struct is designed to be used across the C ABI boundary, ensuring compatibility with both Rust and C plugins.

The configuration system

The configuration system in the Gateway provides a robust and flexible way to customize the behavior of the Gateway and its plugins. By using JSON configuration files, users can easily define and manage settings, ensuring that the Gateway operates according to their specific needs. The system supports both general configurations for global settings and plugin-specific configurations for individual plugin.

The distributed runtime system

The Gateway supports a distributed architecture where multiple runtimes can operate together, either on the same machine or across different machines. This design allows for scalability, redundancy, and security. When creating a new runtime, it will connect to the Service Hub, which provides the necessary configuration to establish connections with other runtimes. For technical details about this feature, refer to runtime documentation.

The publish/subscribe system

The Gateway’s datapoint publish/subscribe system is designed to enable efficient, reliable communication between plugins by allowing them to publish datapoint values and subscribe to updates, facilitating real-time data exchange and processing.

Each plugin can be configured, via the plugin configuration, to receive data either asynchronously or synchronously based on use case requirements, ensuring optimal message delivery speed and efficiency. Additionally, the asynchronous broker configuration allows users fine-grained control over system resources.