I2C Read

I am trying to read data from arduino to a slave device. I understood that during master read clock should be sent by master. But I observed in oscilloscope that the master immediately stops after sending the slave address. My read function is as follows.

char Read(int Slave_Address, int SIR_Number)
{
Wire.beginTransmission(Slave_Address);
Serial.write(“in function”);
Wire.write(SIR_Number);
Serial.write(SIR_Number);
Wire.endTransmission();
Wire.requestFrom(Slave_Address, 1);
while(Wire.available())
ch = Wire.read(); // receive a byte as character
Wire.endTransmission();
return ch;
}

Look in the Arduino’s IDE under Examples, there is example code for reading an I2C device.

Please read the how to use this forum sticky to see how to post code.
Are you sure your address is correct, the Arduino uses 7 bit addresses not 8 bit ones. If you have an 8 bit address shift it one place to the right.

Use this I2C scanner to confirm the address and that the device will communicate on the bus. If the scanner finds your device and reports an address, use the reported address in your code.

// I2C scanner by Nick Gammon.  Thanks Nick.

#include <Wire.h>

void setup() {
  Serial.begin (115200); //*****  make sure serial monitor baud matches *****

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

The OP's codes:

char Read(int Slave_Address, int SIR_Number)
{
  Wire.beginTransmission(Slave_Address);
  Serial.write("in function");
  Wire.write(SIR_Number);
  Serial.write(SIR_Number);
  Wire.endTransmission();
  Wire.requestFrom(Slave_Address, 1); 
  while(Wire.available())
  ch = Wire.read(); // receive a byte as character
  Wire.endTransmission();
  return ch;
}

The above codes when written in compliance with I2C Protocol, it stands as follows:

char Read(int Slave_Address, int SIR_Number)
{
  Wire.beginTransmission(Slave_Address);  //queued slave's address
  Wire.write(SIR_Number);                        //queued target location address 
  Wire.endTransmission();                         //the queued data are transmitted
 
  Wire.requestFrom(Slave_Address, 1);  //looping code; terminates once data arrives into FIFO buffer of Master
  ch = Wire.read();                              // bring data into user variable from FIFO buffer
  return ch;
}

The OP is requested to test the above codes and report the result.