•  


GitHub - slowtec/tokio-modbus: A tokio-based modbus library
Skip to content

slowtec/tokio-modbus

Repository files navigation

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

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본