rust7 0.1.2

Native Rust S7 client (Snap7-style) for Siemens PLCs.
Documentation
  • Coverage
  • 42.55%
    20 out of 47 items documented5 out of 18 items with examples
  • Size
  • Source code size: 285.36 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.01 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • davenardella/Rust7
    21 4 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • davenardella

Rust7 - Native Rust S7Client

Pragmatic native Rust S7 client (Snap7‑style) for Siemens PLCs.


Features

  • Pure Rust, no unsafe code.
  • Low latency: ≈ 1ms/PDU.
  • Small footprint.
  • Strict control of incoming headers.
  • Automatic telegram splitting for large reads/writes.
  • Connection helpers methods for S71200/1500 and S7300.

Quick start

use rust7::client::{S7Client};

fn main() {
    let mut client = S7Client::new();
    let db_number: u16 = 100; // Must exist into the PLC

    // Connection
    match client.connect_s71200_1500("192.168.0.100") {
        Ok(_) => { println!("Connected to PLC") },
        Err(e) => {
            eprintln!("Connection failed: {}", e);
            return;
        }
    }
    // Reads 64 byte from DB100
    println!("");
    println!("Attempt to read 64 byte from DB100");
    let mut read_buffer = vec![0u8; 64];
    match client.read_db(db_number, 0, &mut read_buffer) {
        Ok(_) => {          
            println!("Success!");
            println!("Job time (ms) : {:.3}", client.last_time);
        },
        Err(e) => eprintln!("Read failed: {}", e),
    }

    client.disconnect();
}

Documentation

The detailed documentation is here.


License

Copyright © 2025 Davide Nardella

Distribuited under MIT License.