STM32 reading data from digimatic SPC and communication via I2C at the same time
This approach can be work.
In the IC2 interrupt;
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode)
{
  UNUSED(AddrMatchCode);

  if(hi2c-&gt;Instance==I2C1)
  {
      if(TransferDirection == TRANSFER_DIR_READ)
      {
          .
          .
          .
      }
      else
      {
         sendData = 1;
      }
  }
}

After reading data from the digimatic;
// After reading data
if(sendData)
{
  HAL_I2C_Slave_Seq_Transmit_IT(&amp;hi2c1, (uint8_t*)aTxBuffer, 8, I2C_LAST_FRAME);
  sendData = 0;
}