Cannot read input register from rs485

@charles221b, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project :wink: See About the Installation & Troubleshooting category.

Please edit your post, select all code and click the </> button to apply code tags and next save your post. It makes it easier to read, easier to copy and prevents the forum software from incorrect interpretation of the code.

Looking at your code, you're using pins 0 and 1 of the Arduino Uno for RS485; those pins are also used for the USB connection to the PC so you have a conflict which can explain the result.

Note that I'm not familiar with ModBus.