AD7787 AIN2 how to read

Dear:

     Now, I use the AD7787 as a AD chip, the AIN1 channel is OK ,but AIN2 failed.

    The code is below:

     AD7787_Init();

    while (1)
   {

         //read AD7787 calibration data
        ad7787_data_1 = AD7787_Read(AD7787_CH1);//AD7787_CH1= 0011 1000
        HAL_Delay(10);

        ad7787_data_2 = AD7787_Read(AD7787_CH2);//AD7787_CH2= 0011 1001
        HAL_Delay(10);

    }

    

void AD7787_Init(void)
{
uint8_t command;
uint8_t dat[4]={0xFF,0xFF,0xFF,0xFF};

AD7787_CS_LOW;
HAL_Delay(1);
command=0x00;
HAL_SPI_Transmit(&hspi2, &command, 1, 100);
HAL_Delay(1);
HAL_SPI_Transmit(&hspi2, dat, 4, 100);// write 32bit 1 to reset
HAL_Delay(1);


//write mode register
command=0x10;
HAL_SPI_Transmit(&hspi2, &command, 1, 100);
HAL_Delay(1);
command=0x06;
HAL_SPI_Transmit(&hspi2, &command, 1, 100);// set U/B to unipolar
HAL_Delay(1);


AD7787_CS_HIGH;

HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
HAL_Delay(10);
}

uint32_t AD7787_Read(uint8_t command)
{
uint32_t buffer=0;
uint8_t dat[3]={0};
uint8_t i;
AD7787_CS_LOW;

HAL_Delay(10);
HAL_SPI_Transmit(&hspi2, &command, 1, 100);
HAL_Delay(10);

HAL_SPI_Receive(&hspi2, dat, 3, 100);//MSB first 24bit
HAL_Delay(10);

AD7787_CS_HIGH;

HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
for(i=0; i<3; i++)
{
buffer = (buffer << 8) + dat[i];
}

AD7787_uvoltage =(uint32_t)(((float)buffer * VREF7787 / (1ul << 24)));

return AD7787_uvoltage;
}