Crates.io | roboplc |
lib.rs | roboplc |
version | 0.3.2 |
source | src |
created_at | 2024-03-04 01:14:55.394279 |
updated_at | 2024-06-22 18:01:35.005548 |
description | Framework for PLCs and real-time micro-services |
homepage | |
repository | https://github.com/roboplc/roboplc |
max_upload_size | |
id | 1161099 |
size | 447,453 |
RoboPLC is an ultimate pack of a framework and tools for creating real-time micro-services, PLCs and industrial-grade robots in Rust.
The crate is designed to let using all its components both separately and together.
RoboPLC is a part of EVA ICS industrial automation platform.
Real-time-safe data synchronization components are re-exported from the RTSC crate which is a part of RoboPLC project and can be used directly, with no requirement to use RoboPLC.
Available at https://info.bma.ai/en/actual/roboplc/index.html
Can be found at https://github.com/roboplc/roboplc/tree/main/examples
[buf::DataBuffer
] covers a typical data exchange pattern when data
frames are collected (cached) from a single or multiple producers, then taken
by a single consumer in bulk and submitted, e.g. into a local database or into
an external bus.
always has got a fixed capacity
thread-safe out-of-the-box
frames may be forcibly pushed, overriding the previous ones, like in a ring-buffer.
[hub::Hub
] implements a data-hub (in-process pub/sub) model, when multiple
clients (usually thread workers) exchange data via a single virtual bus instead
of using direct channels.
This brings some additional overhead into data exchange, however makes the architecture significantly clearer, lowers code support costs and brings additional features.
classic pub/sub patterns with no data serialization overhead
based on [pchannel
] which allows to mix different kinds of data and apply
additional policies if required
a fully passive model with no "server" thread.
A policy-based deque [rtsc::pdeque::Deque
] is a component to build policy-based
channels.
[pchannel
] is a channel module, based on the policy-based deque.
Data policies supported:
Additionally, components support ordering by data priority and automatically drop expired data if the data type has got an expiration marker method implemented.
[pchannel
] is a real-time safe channel, mean it may be not so fast as popular
channel implementations (it may be even slower than channels provided by
[std::sync::mpsc
]). But it is completely safe for real-time applications,
mean there are no spin loops, data is always delivered with minimal latency and
threads do not block each other.
[thread_rt::Builder
] provides a thread builder component, which extends the
standard thread builder with real-time capabilities: scheduler policies and CPU
affinity (Linux only).
[supervisor::Supervisor
] provides a lightweight task supervisor to manage
launched threads.
[controller::Controller
] is the primary component of mixing up all the
functionality together.
[io
] module provides a set of tools to work with field devices and SCADA
buses.
Currently supported:
Modbus (RTU/TCP) via [io::modbus
] (Modbus client/master
example,
Modbus server/slave
example),
requires modbus
crate feature.
Raw UDP in/out via [io::raw_udp
]
(Raw UDP in/out example)
Subprocess pipes via [io::pipe
]
(Subprocess pipe example)
EVA ICS EAPI in/out via [io::eapi
] (EVA ICS
example),
requires eapi
crate feature.
The components [thread_rt
], [supervisor
] and [controller
] can work on
Linux machines only.