Serial Communication

The code in my arduino mega:

void setup(){

  Serial.begin(57600);
  Serial1.begin(57600);
  Wire.begin();
  SLAVE_I2C_INIT();
  HMC.init();  
}
void loop()
{
  int test1;
  if (Serial1.available() > 0) 
  {
           test1= Serial1.read();
  }         
  Serial.print("B");
  Serial.print(test1);
  Serial.println();
  delay(400);
 int kleinste=3;
 int check=0;
        if (read_IRsensor_range(afst0) <40) //indien afstand langs voor 
         { kleinste =0; 
           check=1;
         }
      if (read_IRsensor_range(afst1) <40)// afstand links
         { kleinste=1;
           check=1;
         }
      if (read_IRsensor_range(afst2)<40)// afstand rechts
         { kleinste=2;
           check=1;
         }
      if (read_IRsensor_range(afst3)<40) //afstand achter
         { kleinste=3; 
           check=1;
         }
      if (check==0){ kleinste=3;  }    
Serial1.print(kleinste);
Serial1.println();

Code on my blimpduiono:

void setup()
{
  Serial.begin(57600);
 
  Init_RC();
  Init_LEDs(); 
  Init_IRs();
  init_ultrasonic();   
  Init_motors();
 
}

void loop()
{ 
  
 if (Serial.available() > 0) 
 {
        au_compare= Serial.read();
 } 
 Serial.print((int)raw_ultrasonic());

Am sending the data serial from a blimpduino to my arduino mega and vica versa. Thats Serial1 on my mega, Serial on my blimpduino. Then from my mega with Xbee (Serial) to my computer.
When i connect my computer directly to my blimpduino i got the data that i want the mega to receive but doesn't work when i try to get the data from the xbee's. Do i read in my data correctly? Or is it someting els that i do wrong

Or is it someting els that i do wrong

It's something else you did wrong. You didn't tell us what kind of XBees you have, how they are connected to the Mega and the PC, or how you have configured them.

What is listening to the serial port on the PC?

Am using the Xbee series 2 they are connected on Serial(not using the usb connector). They are configured as router and coordinator on baud rate 57600. Am getting the data correctly from the other sensors that i have connected directly on the arduino mega.