Yet another Modbus client library for .NET.
- RTU, ASCII and TCP protocols via serial or network connection.
- Implemented read/write functions (Modbus function codes):
- Read Coils / Discrete Inputs / Holding Registers / Input Registers (1/2/3/4)
- Write Single Coil / Holding Register (5/6)
- Write Multiple Coils / Holding Registers (15/16)
- Splitting single read/write requests into multiple requests with valid number of memory elements.
- Automatic reconnection to device.
- Support of multiple devices on the same serial port or network connection (share the same
Streaminstance between clients). - Possibility of other Modbus function code (including user-defined) implementation.
- Execution of several commands as one atomic sequence via
PL.Modbus.Client.CreateSession. - Asynchronous counterparts (
...Asyncmethods, e.g.ReadHoldingRegistersAsync,CreateSessionAsync) for every operation, withCancellationTokensupport.
For Modbus TCP and Modbus ASCII PL.Modbus.Client.Command/CommandAsync and PL.Modbus.ClientSession.Command/CommandAsync methods can be used with any function code, since these protocols allow to receive responce data without knowing its size beforehand.
For Modbus RTU descendant Client class should be created with overriden PL.Modbus.Client.ReadRtuData/ReadRtuDataAsync method.
Simple Modbus client application.
Tests client-server connection and measures transaction rate.
Tests Modbus server by writing to random memory locations, reading back and comparing data.
Modbus (Wikipedia)
Modbus Protocol Specification
Modbus Serial Line Protocol and Implementation Guide