I would like to use a PC as a master and two Arduino Nano as slaves with Max485. Each Arduino slave will use one Max485 with one LED and one button. I don't know know much about ModBus. I see Arduino IDE library has ArduinoModbus.h. I am not sure if they are good or not. I am looking for simple code that I can communicate with two Arduino slaves from PC on serial monitor. I see a lot of sample codes for two arduino which one is master and other is slave on RS485 with Modbus. I am not sure if we can use Modbus on Serial monitor. I have download Modbus tester. I am not sure how to use it and how to write the codes for both two slaves with Modbus.
For wire connect.
USB to RS485 connector on the PC RS485 Pin A to Max485 Pin A, Pin B to Max485 Pin B
two Max485 and two Arduno Nano
Max 485 Pin Di connects to Ardunio TX Pin
Max 485 Pin DE and RE connects both to Ardunio Pin 2
Max 485 Pin RO connects to Arduino RX pin
Button Pin 1 to GND Pin 2 to Ardunio Pin 12
LED one pin to resistor 220 ohm then connect to the GND and other other one to Arduino pin Pin 10