Expand description
§modbus-core
A no-std Rust modbus library.
§Installation
Add this to your Cargo.toml
:
[dependencies]
modbus-core = "*"
If you like to use Modbus TCP only:
[dependencies]
modbus-core = { version = "*", default-features = false, features = ["tcp"] }
If you like to use Modbus RTU only:
[dependencies]
modbus-core = { version = "*", default-features = false, features = ["rtu"] }
§Protocol-Specification
- MODBUS Application Protocol Specification v1.1b3 (PDF)
- MODBUS over serial line specification and implementation guide v1.02 (PDF)
- MODBUS Messaging on TCP/IP Implementation Guide v1.0b (PDF)
§License
Copyright 2018-2024 slowtec GmbH
MIT/Apache-2.0
Modules§
Structs§
- Coils
- Packed coils
- Coils
Iter - Coils iterator.
- Data
- Modbus data (u16 values)
- Data
Iter - Data iterator
- Exception
Response - A server (slave) exception response.
- Request
Pdu - Represents a message from the client (slave) to the server (master).
- Response
Pdu - Represents a message from the server (slave) to the client (master).
Enums§
- Decoder
Type - The type of decoding
- Error
- modbus-core Error
- Exception
- A server (slave) exception.
- Function
Code - A Modbus function code.
- Request
- A request represents a message from the client (master) to the server (slave).
- Response
- The response data of a successfull request.
Traits§
- Encode
- Encode a struct into a buffer.
Functions§
- bool_
to_ u16_ coil - Turn a bool into a u16 coil value
- pack_
coils - Pack coils into a byte array.
- packed_
coils_ len - Calculate the number of bytes required for a given number of coils.
- u16_
coil_ to_ bool - Turn a u16 coil value into a boolean value.
- unpack_
coils - Unpack coils from a byte array.