| Crates.io | rplc |
| lib.rs | rplc |
| version | 0.3.0 |
| created_at | 2023-04-26 20:49:36.071509+00 |
| updated_at | 2023-07-29 21:38:46.05905+00 |
| description | PLC programming in Rust |
| homepage | |
| repository | https://github.com/eva-ics/rplc |
| max_upload_size | |
| id | 849808 |
| size | 269,387 |
rPLC project allows to write PLC programs for Linux systems in Rust using classical PLC programming approach.
rPLC supports Modbus and OPC-UA input/output protocols out-of-the-box and can be easily extended with custom I/O as well.
rPLC is a part of EVA ICS open-source industrial automation eco-system.
use rplc::prelude::*;
mod plc;
#[plc_program(loop = "200ms")]
fn tempmon() {
let mut ctx = plc_context_mut!();
if ctx.temperature > 30.0 {
ctx.fan = true;
} else if ctx.temperature < 25.0 {
ctx.fan = false;
}
}
fn main() {
init_plc!();
tempmon_spawn();
run_plc!();
}
Available at https://info.bma.ai/en/actual/rplc/index.html