![]() The Modbus specs define a big-endian data layout, i.e. Once you have an instance, connect using a free COM port: client.Connect("COM1") use specified IP address and default port 502Ĭlient.Connect(IPAddress.Parse("127.0.0.1")) Ĭlient.Connect(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 502))Īlternatively, a new Modbus RTU client can be created with the following code: // use default COM port settings Once you have an instance, connect to a server in one of the following ways: // use default IP address 127.0.0.1 and port 502 ![]() ![]() NET Core project with the FluentModbus package installed: PS> dotnet new consoleĪ new Modbus TCP client can be easily created with the following code: var client = new ModbusTcpClient() Here is a screenshot of the sample console output using a Modbus TCP server and client: Please see the introduction below to get a more detailed description on how to use this library! Note: The Modbus clients implement each function code in a synchronous and an asynchronous version ( async/await). Both, the server and the client, implement class 0, class 1 and class 2 (partially) functions of the specification. NET Standard library (2.0 and 2.1) that provides Modbus TCP/RTU server and client implementations for easy process data exchange.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |