MyGit

slowtec/tokio-modbus

Fork: 121 Star: 409 (更新于 2024-10-24 12:01:07)

license: Apache-2.0

Language: Rust .

A tokio-based modbus library

最后发布版本: v0.7.1 ( 2023-02-28 20:00:17)

GitHub网址

tokio-modbus

A pure Rust Modbus library based on tokio.

Crates.io Docs.rs Security audit Continuous integration MIT licensed Apache 2.0 licensed

Modbus is based on a master/slave communication pattern. To avoid confusion with the Tokio terminology the master is called client and the slave is called server in this library.

Features

  • Pure Rust library
  • Modbus TCP or RTU at your choice
  • Both async (non-blocking, default) and sync (blocking, optional)
  • Client API
  • Server implementations
    • for out-of-the-box usage or
    • as a starting point for a customized implementation
  • Open source (MIT/Apache-2.0)

Installation

Add this to your Cargo.toml:

[dependencies]
tokio-modbus = "*"

Cargo Features

  • "rtu": Asynchronous RTU client (default)
  • "tcp": Asynchronous TCP client (default)
  • "rtu-sync: Synchronous RTU client
  • "tcp-sync": Synchronous TCP client
  • "rtu-server": (Asynchronous) RTU server
  • "tcp-server": (Asynchronous) TCP server
  • "rtu-over-tcp-server": (Asynchronous) RTU over TCP server

Examples

If you only need an asynchronous TCP client add the following line to your Cargo.toml file:

[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["tcp"] }

For an asynchronous RTU client:

[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["rtu"] }

For an RTU server:

[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["rtu-server"] }

For a TCP server:

[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["tcp-server"] }

Examples

Various examples for Modbus RTU and TCP using either the asynchronous or synchronous API can be found in the examples folder.

Testing

The workspace contains documentation, tests, and examples for all available features.

cargo test --workspace
cargo test --workspace --all-features

Protocol-Specification

License

Copyright (c) 2017-2024 slowtec GmbH

MIT/Apache-2.0

最近版本更新:(数据更新于 2024-10-12 21:55:01)

2023-02-28 20:00:17 v0.7.1

2023-02-14 16:52:31 v0.7.0

2023-01-31 00:48:27 v0.6.0

2021-11-21 21:00:54 v0.5.1

2021-08-20 17:30:14 v0.5.0

2021-08-13 18:47:00 v0.4.1

2021-07-29 03:41:24 v0.4.0

2019-09-17 18:43:01 v0.3.5

2019-05-21 22:09:50 v0.3.4

2019-05-16 16:07:29 v0.3.3

主题(topics):

ascii, async, automation, client, fieldbus, library, modbus, non-blocking, rtu, rust, server, support, tcp, tokio

slowtec/tokio-modbus同语言 Rust最近更新仓库

2024-11-05 08:48:52 lapce/lapce

2024-11-01 09:38:24 dashpay/platform

2024-11-01 02:26:55 mediar-ai/screenpipe

2024-10-30 06:09:45 electric-capital/crypto-ecosystems

2024-10-29 10:21:58 rustdesk/rustdesk

2024-10-27 15:42:03 jtroo/kanata