Arduino UNO and MODBUS Example code

Hi Experts-

Does anyone have an example of MODBUS code.
I'm trying to implement a MODBUS Master Salve over serial.

Arduino UNO will be the master.
A Sensor with UART, Modbus protocol. Direction control pin for direct
connection to RS485 receiver integrated circuit.

How do i assign the slave ID

Also, I'm using software serial to communicate with the device as I'm using the USB to communicate from the computer to Arduino

Thanks much

B

Software serial maxes out at 19200 or so I have read.

You might want to opt for the Mega 2560.