compile error while want to use tx and rx pin for communication in UNO

I want to my UNO arduino communicate with other device through rx and tx ,when i compile program compiler give me below error :
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.

i use below program:
https://code.google.com/p/simple-modbus/
that tx and rx part declare in below line:
modbus_configure(&Serial, baud, SERIAL_8N1, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);

but when i use Mega arduino everything is good and my arduino properly connect to other device!
why?

The message is pretty clear. The Mega has more space for program memory. When you compile the program for the Mega what does it say for the amount of memory used?

KeithRB:
The message is pretty clear. The Mega has more space for program memory. When you compile the program for the Mega what does it say for the amount of memory used?

it say:
Sketch uses 4,942 bytes (1%) of program storage space. Maximum is 253,952 bytes.
Global variables use 2,316 bytes (28%) of dynamic memory, leaving 5,876 bytes for local variables. Maximum is 8,192 bytes.

You only have 2K of SRAM available on the UNO. Do you have a lot of strings or large constant arrays? You can put them in FLASH.

Post your code

KeithRB:
You only have 2K of SRAM available on the UNO. Do you have a lot of strings or large constant arrays? You can put them in FLASH.

Post your code

my code is According to below site:
https://code.google.com/p/simple-modbus/

#include <LiquidCrystal.h>

#include <SimpleModbusMaster.h>

/*
The example will use packet1 to read a register from address 0 (the adc ch0 value)
from the arduino slave (id=1). It will then use this value to adjust the brightness
of an led on pin 9 using PWM.
It will then use packet2 to write a register (its own adc ch0 value) to address 1
on the arduino slave (id=1) adjusting the brightness of an led on pin 9 using PWM.
*/

//////////////////// Port information ///////////////////
#define baud 9600
#define timeout 1000
#define polling 200 // the scan rate
#define retry_count 10

// used to toggle the receive/transmit pin on the driver
#define TxEnablePin 2

#define LED 9

// The total amount of available memory on the master to store data
#define TOTAL_NO_OF_REGISTERS 1000

// This is the easiest way to create new packets
// Add as many as you want. TOTAL_NO_OF_PACKETS
// is automatically updated.
enum
{
PACKET1,
PACKET2,
TOTAL_NO_OF_PACKETS // leave this last entry
};

// Create an array of Packets to be configured
Packet packets[TOTAL_NO_OF_PACKETS];

// Masters register array
unsigned int regs[TOTAL_NO_OF_REGISTERS];
int In22=22;

void setup()
{
// Initialize each packet
modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 100, 5, 0);
modbus_construct(&packets[PACKET2], 1, PRESET_MULTIPLE_REGISTERS, 1, 1, 0);

// Initialize the Modbus Finite State Machine
modbus_configure(&Serial, baud, SERIAL_8N1, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);

pinMode(LED, OUTPUT);
}

void loop()
{
modbus_update();

}

#define TOTAL_NO_OF_REGISTERS 1000

// Masters register array
unsigned int regs[TOTAL_NO_OF_REGISTERS];

You are asking to create 2000 bytes of registers. This will not fit on an UNO

KeithRB:
#define TOTAL_NO_OF_REGISTERS 1000

// Masters register array
unsigned int regs[TOTAL_NO_OF_REGISTERS];

You are asking to create 2000 bytes of registers. This will not fit on an UNO

thanks in advance KeithRB
my problem is solved with change value TOTAL_NO_OF_REGISTERS