This seems somewhat straightforward, but maybe it is not.
I'm experimenting with a 32-digital Input module, said to have "MODBUS RTU 03 06 command control mode". See attached.
I have it working (somewhat) using a simple Arduino sketch, verifying this example:
Using the Arduino, the RS485 is...