Converting old hardware serial code to newsofwareserial code

im working away on some old modbus communication examples but unfortunately they use the hardware serial port to transmit/receive.
could someone please suggest how it can be changed to use NewSoftwareSerial instead.

void setup()
{
        const int baudrate = 9600;
        if (baudrate <= 19200)
                interframe_delay = (unsigned long)(3.5 * 11 / baudrate);  /* Modbus t3.5 */
        Serial.begin(baudrate); 	/* format 8N1, DOES NOT comply with Modbus spec. */
}
  1. Use Arduino 1.0 or newer and SoftwareSerial
  2. Create a SoftwareSerial object (http://arduino.cc/en/Reference/SoftwareSerial)
  3. Use that in place of Serial.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
        const int baudrate = 9600;
        if (baudrate <= 19200)
                interframe_delay = (unsigned long)(3.5 * 11 / baudrate);  /* Modbus t3.5 */
        mySerial.begin(baudrate); 	/* format 8N1, DOES NOT comply with Modbus spec. */
}

Thanks John,
much appreciated