Relative Content

Tag Archive for c#serial-portmodbusindustrial

Using NModbus for reading and writing values on a slave device

Trying to read/write values to an established slave device using Nmodbus in c#. The goal is to send several commands to some holding registers and read values from some input registers. The holding registers are 40001-4004, and the input registers are 30001 through 30015, although for what needs to be measured and monitored, there’s only a couple needed. There is code in there that talks about a relay board, but that is fully functional and doesn’t need any attention at the moment. I will be taking these values and reporting them into a txt file, but I am more concerned with getting the Modbus working before going any further. The information for the COM port and serial information is correct.