#plc #modbus #automation #opcua

bin+lib rplc

PLC programming in Rust

15 releases

0.3.0 Jul 29, 2023
0.2.4 Jul 10, 2023
0.2.0 Jun 18, 2023
0.1.11 Jun 1, 2023
0.1.0 Apr 26, 2023

#681 in Hardware support

Download history 3/week @ 2024-02-26 153/week @ 2024-03-04

156 downloads per month

Apache-2.0

185KB
5K SLoC

rPLC - PLC programming for Linux in Rust crates.io page docs.rs page

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.

A quick example

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!();
}

Technical documentation

Available at https://info.bma.ai/en/actual/rplc/index.html

Dependencies

~18–37MB
~578K SLoC