How to control VFD using RS485 module and Arduino mega?
Connect the RS-485 adapter to one of the hardware serial interfaces (I suggest Serial1), connect the DE/RE signal to a free digital IO on the Mega, install a ModBus master library (the library manager of the IDE offers you one) and configure the inverter with it.