RF 433MHz [SENDING DATA PROBLEM]

Hello,

I want to send different values form one Arduino to another using 433Mhz modules

The problem is in receiving data, sometimes it’s getting messy and mixes the values.
I want to receive data in order they were sent.

Code for TX:

#include <VirtualWire.h>
#define TX_PIN 11 //PWM

typedef struct RemoteData_1
{
  int    data_1;
};

typedef struct RemoteData_2
{
  int    data_2;
};

void setup()
{
  Serial.begin(9600);
  vw_setup(2000);
  vw_set_tx_pin(TX_PIN);
}

void loop()
{
  struct RemoteData_1 payload_1;

  payload_1.data_1 = 123;
  
  vw_send((uint8_t *)&payload_1, sizeof(payload_1));
  vw_wait_tx();

    struct RemoteData_2 payload_2;

  payload_2.data_2 = 456;
  
  vw_send((uint8_t *)&payload_2, sizeof(payload_2));
  vw_wait_tx();
  
  delay(1000);
}

Code for RX:

#include <VirtualWire.h>
#define RX_PIN 11 //PWM

typedef struct RemoteData_1
{
  int    data_1;
};

typedef struct RemoteData_2
{
  int    data_2;
};

void setup()
{
  Serial.begin(9600);
  vw_setup(2000);
  vw_set_rx_pin(RX_PIN);
  vw_rx_start();
}

void loop()
{
  struct RemoteData_1 receivedData_1;
  uint8_t rcvdSize_1 = sizeof(receivedData_1);
  vw_wait_rx();
  
  if (vw_get_message((uint8_t *)&receivedData_1, &rcvdSize_1))
  {
    Serial.println("..........Received..........");
    Serial.print("data_1:");
    Serial.println(receivedData_1.data_1);
  }

  struct RemoteData_2 receivedData_2;
  uint8_t rcvdSize_2 = sizeof(receivedData_2);
  vw_wait_rx();

  if (vw_get_message((uint8_t *)&receivedData_2, &rcvdSize_2))
  {
    Serial.print("data_2:");
    Serial.println(receivedData_2.data_2);
    Serial.println("............................");
  }
}

Regards, Lucas

Problem solved.