D
D
Denis Kharchenko2022-03-06 18:43:58
.NET
Denis Kharchenko, 2022-03-06 18:43:58

How to implement Modbus TCP Server in dotnet 6 as an API application?

I have an industrial 4G router (TCP Server, TCP Client modes) with a Serial Line connected to it (UDP, UDP Multicast, TCP Server, TCP Client modes, Modbus RTU Master, Modbus RTU Slave, Modbus ASCII Master, Modbus ASCII Slave, RealCOM_MCP, RealCOM_CCP, RealCOM_MW, Pair Connection Master, Pair Connection Slave, Httpd Client, WebSocket Client) and connected sensor via RS485.

If I select the Modbus RTU Slave mode, then I can connect and receive data from the sensor. But my situation is the opposite, I need to create a Modbus TCP Server to which the Serial Line will be connected.

I used the library https://github.com/NModbus/NModbus
I came across the fact that when creating an IHostedService I cannot connect to it, although through Netstat -a I see the IP address and port on which I created the server.

Who can explain how to make a Modbus TCP Server that will send and receive messages from sensors.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question