Modbus RTU slave library
so i edited code your as below
    #define mySerial Serial1

byte test_data[8] = {0x01,0x03,0x00,0x64,0x00,0x02,0x85,0xD4};

int data_count = 5;


void setup() {

mySerial.begin(9600);
Serial.begin(9600);
delay(1000);

}
int count = 0; 
void loop() {

  if(count%10 == 0) {
    Serial.println();
    send_data();
  }

  count++;

  while(mySerial.available()&gt;0)
  {
    byte b=mySerial.read();
    delay(1);
    Serial.print(b,HEX);
    Serial.print(" ");
  }
  //Serial.println(count);
  while(Serial.available())
  {

    byte a=Serial.read();
    delay(1);
    mySerial.print(a);

  }


  delay(1000);

}

void send_data() {
  Serial.println("send data");


  delay(1);
  for(char i=0;i&lt;8;i++){
    mySerial.write(test_data[i]);
    delay(1);
    Serial.print(test_data[i],HEX);
    Serial.print(" ");
  }

  Serial.println();

  delay(1);