Modbus slave timeout error

Remove these lines, they just slow everything down:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);

This part doesn't compile for me:

  modbus_configure(&Serial1, 9600, SERIAL_8N1, 1, 2, HOLDING_REGS_SIZE, holdingRegs);

which is correct because the definition is

void modbus_configure(HardwareSerial* SerialPort,
											long baud,
											unsigned char byteFormat,
											unsigned int _timeout, 
											unsigned int _polling, 
											unsigned char _retry_count, 
											unsigned char _TxEnablePin, 
											Packet* _packets, 
											unsigned int _total_no_of_packets)

I guess you're using an old version. Why are you using an old version and which version are you using?

After that I use one Modbus Master simulator to check it: got a timeout error at last..Is there anything wrong with this?

What configuration did you use there?

Hi guys, i connect my arduino YUN to a TTL to RS232 adapter and then use a USB to RS232 adapter to PC.

Post a wiring diagram or sharp photo of your hardware setup.