If you want to send the I/O status to your MQTT broker periodically, you can configure Modbus TCP Server and Modbus TCP Client on RUT956 to get I/O information from itself periodically. Then, configure Data To Server to send this Modbus data to your MQTT broker.
You can find information about Modbus registers on RUT956 here.
You are almost there. You should also configure Modbus TCP Client on RUT that will request information from itself. In the Modbus TCP client configuration, put the LAN IP address of RUT (or 127.0.0.1 loopback) and configure the Modbus requests that you need. For example:
For the requests, make sure that you select the correct Data Type and function code (Read Holding Registers (3)). You can refer to the Modbus Monitoring wiki page that I have linked previously.
Read Holding Registers (3) was the reason why it wasn’t working before.
Now I’m able to transmit the status of the digital input to our MQTT Broker
Remarks
I have configured the Data to Server to have 3 sections in the MQTT topic (see screenshot above). I noticed that the MQTT message with the 3 sections is immediatly followed by another message with only 2 sections. The Modbus section is gone. Do you have an idea why?
I also noticed that I can specify multiple request configurations in the Modbus TCP Client configuration but only the last one is transmitted over MQTT. I’m using the JSON format type.
Edit the configurations of your Modbus Data input in Data to Server and set the segment count to 4 (the number of Modbus Requests you have configured in Modbus client configurations).