write multiple requests to serial device--->serial.read() getting confused data

Hello Everyone!
At the moment I’m still working on a project where I have to communicate with a device via a RS232 Interface.
Actually the communication between the Arduino (UNO and Leonardo) works fine (I’m receving the correct response using Serial1.read()…)
BUT:
As soon as I send in void loop() more than one Request to the device (the requests are different, adressing different parameters of the device), I’m not receiving correct Responses anymore…The Responses I receive looks for me rendomlyas, if the correct order of the data get mixed up somehow. Some Responses are correct, other not, or just some Data of them are in the correct order…
The code I’m using is the following (for ARDUINO LEONARDO):
(NOTE: the code is maybe quite long, but all 3 Requests are nearly the same)

  /*
  This sketch is to read data from the Xtender via the Xcom-232i Communication module
  */  
  byte Response [30];   //Response Xcom- Communication, Received Values Format FLOAT-->32bit little endian
  byte Response2 [30]; //Response Xcom- Communication, Received Values Format FLOAT-->32bit little endian
  byte Response3 [28];  //Response Xcom- Communication, Received Values Format ENUM -->16bit integer
  byte Request [26];      // Request Xcom- Communication
  
  //variables for receiving correct values out of whole Response
  byte dataread_float[4];
  byte dataread_enum[2];
  float responed_value_3004;
  float responed_value_3022;
  int responed_value_3010;

  //LED- Blinking for indicating if Xtender is available
  int led_xtender_available = 4;
  int led_xtender_not_available = 13;
  /*
  Frame for communication between the Xcom-rs232i and the ARDUINO UNO:
  This frame is set after the "Xtender serial protocol", which you can find at the Studer Homepage: 
  http://www.studer-inno.com/?cat=sine_wave_inverter-chargers&id=432&tab=2 by clicking on "SOFTWARE&UPDATES".
  */
  //-------------------------------------------------------------------start header-------------------------------------------
  //Request line 26bytes, Hexadecimal:
  //start_byte 1Byte
  byte start_byte = 0xAA;
  //-------------------------------------------------------------------endheader--------------------------------------------------------
 //-------------------------------------------------------------------voidsetup----------------------------------------------------------
  void setup()
  {
  /*
  Open serial communication:set USART_Configurations: 38400bps, 1start bit, 8bit of data, 1 parity bit, even parity, 1 stop bit
  Serial1: communicates with TX and RX
  */
  Serial1.begin(38400,SERIAL_8E1);
  //set LED as OUTPUT
  pinMode (led_xtender_available, OUTPUT);
  pinMode (led_xtender_not_available, OUTPUT); 
  
  //open SerialPort for debugging
  Serial.begin(38400); 
  while (!Serial) {  }
}
 //--------------------------------------------------------------------void loop------------------------------------------------- 
 void loop(){
   
  //preparing Request1:-----------------------------------------------Request_1-------------------------------------------------------
byte Request[26] = {0xAA,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x0A,0x00,0x6F,0x71,0x00,0x01,0x01,0x00,0xBC,0x0B,0x00,0x00,0x01,0x00,0xC9,0xA8};
  //sending Request1 to the xtender
  for (int i=0; i<sizeof(Request); i++)
  {
  Serial1.write(Request[i]);
  //Serial.println(Request[i],HEX);
  } 
  //wait till Xtender gets Response
  delay(500); 
  //proof via LED Blinking, if Xtender is available
  if(Serial1.available()>=30){
    digitalWrite(led_xtender_available, HIGH);
    digitalWrite(led_xtender_not_available, LOW);
    
    //reading Xtender Response, start at startbyte:
    if (Serial1.read ()== start_byte)
    {      
      //save startbyte at first digit of Response
      Response [0] = start_byte;
      //save Response in an array  
      for (int n=1; n<30; n++){
      Response [n] = Serial1.read();
    }
         print Response
         Serial.println("Response:3004"); 
        for (int k = 0; k< sizeof(Response); k++)
        {
         Serial.println(Response[k],HEX);
         //delay(500);
      }
    //save specific bytes as useful variables (4Byte HEX to 4Byte Float)
    for (int i = 0; i<4; i++)
    {
    dataread_float[i] = Response[24+i];
    //Serial.println(dataread_float[i],HEX);
    }
    responed_value_3004 = *((float *) dataread_float);
    Serial.print("Responed Value 3004 : ");
    Serial.println(responed_value_3004);  
    }
  
  }
  else
  { 
  digitalWrite(led_xtender_not_available, HIGH);
  digitalWrite(led_xtender_available, LOW);
  }

  //-----------------------------------------------Request_2----------------------------------------------
byte Request2[26] = {0xAA,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x0A,0x00,0x6F,0x71,0x00,0x01,0x01,0x00,0xCE,0x0B,0x00,0x00,0x01,0x00,0xC9,0xA8};
  //sending Request1 to the xtender
  for (int i=0; i<sizeof(Request2); i++)
  {
  Serial1.write(Request2[i]);
  //Serial.println(Request2[i],HEX);
  }
  delay(500);
  //proof via LED Blinking, if Xtender is available
  if(Serial1.available()>=30){
    digitalWrite(led_xtender_available, HIGH);
    digitalWrite(led_xtender_not_available, LOW);
    
    //reading Xtender Response, start at startbyte:
    if (Serial1.read ()== start_byte){      
      //save startbyte at first digit of Response
      Response2 [0] = start_byte;
      //save Response in an array  
      for (int n=1; n<30; n++){
      Response2 [n] = Serial1.read();}
      //print Response
        Serial.println("Response_2:3022"); 
       for (int k = 0; k< sizeof(Response2); k++){  
        Serial.println(Response2[k],HEX);
      }
    //save specific bytes as useful variables (4Byte HEX to 4Byte Float)
    for (int i = 0; i<4; i++)
    {
    dataread_float[i] = Response2[24+i];
    //Serial.println(dataread_float[i],HEX);
    }
    responed_value_3022 = *((float *) dataread_float);
    Serial.print("Responed Value 3022 : ");
    Serial.println(responed_value_3022);  
  }
  }
  else
  {
  digitalWrite(led_xtender_not_available, HIGH);
  digitalWrite(led_xtender_available, LOW); 
  }

  //----------------------------------------------Request_3------------------------------------------------------------
byte Request3[26] = {0xAA,0x00,0x01,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x0A,0x00,0x6F,0x71,0x00,0x01,0x01,0x00,0xC2,0x0B,0x00,0x00,0x01,0x00,0xC9,0xA8};

  //sending Request1 to the Xtender
  for (int i=0; i<sizeof(Request3); i++)
  {
  Serial1.write(Request3[i]);
  //Serial.println(Request3[i],HEX);
  }
  delay(500);
  //proof via LED Blinking, if Xtender is available
  if(Serial1.available()>=30){
    digitalWrite(led_xtender_available, HIGH);
    digitalWrite(led_xtender_not_available, LOW);
    
    //reading Xtender Response, start at startbyte:
    if (Serial1.read ()== start_byte){      
      //save startbyte at first digit of Response
      Response3 [0] = start_byte;
      //save Response in an array  
      for (int n=1; n<28; n++){
      Response3 [n] = Serial1.read();}
      //print Response
      Serial.println("Response_3:3010"); 
      for (int k = 0; k< sizeof(Response3); k++){ 
      Serial.println(Response3[k],HEX);
    }
    //save specific bytes as useful variables (2Byte HEX to 2Byte INT)
    for (int i = 0; i<2; i++)
    {
    dataread_enum[i] = Response3[22+i];
    //Serial.println(dataread_enum[i],HEX);
    }
    responed_value_3010 = *((float *) dataread_enum);
    Serial.print("Responed Value 3010 : ");
    Serial.println(responed_value_3010);    
  }
  }
  else
  {
  digitalWrite(led_xtender_not_available, HIGH);
  digitalWrite(led_xtender_available, LOW); 
  }
 }
 }

I’m really looking forward to any help!

maybe it has to do something with the serial buffer? that in the buffer are still values from the first request?

ok. found the problem on my own....I had a mistake in my code:
I used this code in Request3 eventhough, I wanted to receive a Response including just 28Bytes....

 if(Serial1.available()>=30)

It's an old post but its worth a shot:

I'am also trying to communicate with my studer system via the Xcom module using a MEGA r3.
With my own code i get nothing or a random value, using requests found in the documentation.
With your code i sometimes get a response that resembles a valid response.

Could you please tell me how you connected your aruino with the system and if you used any other code.