Crate rplc

Source
Expand description

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

Modules§

api
builder
client
comm
eapi
export
interval
io
prelude
server
tasks

Macros§

init_plc
plc_context
plc_context_mut
run_plc

Structs§

PlcInfo

Constants§

DEFAULT_STOP_TIMEOUT
DEFAULT_TIMEOUT

Statics§

CPUS
DESCRIPTION
NAME
STACK_SIZE
VERSION

Functions§

cpus
hostname
Panics
init
use init_plc!() macro to init the PLC
run
use run_plc!() macro to run the PLC
uptime
Panics
var_dir

Type Aliases§

LockedContext