Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Repository files navigation

Impotant Information!
As this implementation has way too many pitfalls, I decided to re-write the whole library.
You can find the new implementation here: https://github.com/AM-WD/AMWD.Protocols.Modbus

Modbus

Implements the Modbus communication protocol, written as a .NET Standard 2.0 library.

Example

You can use the clients without any big knowledge about the protocol:

stringhost="modbus-device.local";intport=502;usingvarclient=newModbusClient(host,port);awaitclient.Connect();bytedeviceIdentifier=5;ushortstartAddress=19000;ushortcount=2;varregisters=awaitclient.ReadHoldingRegisters(deviceIdentifier,startAddress,count);floatvoltage=registers.GetSingle();Console.WriteLine($"The voltage between L1 and N is: {voltage:N2}V");

For the people who have seen some devices: yes, it's a request to a Janitza device ;-).

License

All packages published under the MIT license.

About

Implementing the Modbus protocol on .NET Standard 2.0

Resources

Stars

33 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages