Continues Read inputs and retrieve data from menu choice too

Hello everyone! I've got a problem and i would like your help.

I've got a very simple source code:

void loop()  {  
  cData = 0;
  while( cData <= 50 ){
      // read the analog in value:
      tempSensorValue = analogRead(analogInPin0);                                        
      Serial.print("T");
      Serial.print(tempSensorValue);     
      Serial.print("-");
      humdSensorValue = analogRead(analogInPin1);       
      Serial.print("H");    
      Serial.print(tempSensorValue);   
      Serial.print("-");       
      cData++;              
  } 
  delay(1000);  
}

And i want a function which retrieve preseted store inforemations from EEPROM like location,an ID etc.

Here is the function:

void __read_EEPROM( )  {
   _addrByte = 0;
  String str;
  int value;
  while( value != 255 )  {
    value = EEPROM.read( _addrByte );
     if( value == 0 ) {
      break;       
     }
     str += (char)(value);
    _addrByte++;  
  }
  Serial.print(str);
}

This two parts of code are the most important for an interface C# application.

My question:
Ok i'm reading data like temperature and others too, but i want with some way to retrieve this informations from eeprom whenever i want.
without any confuse on my data.

e.g See below:

void loop()  {  
  cData = 0;
  while( cData <= 50 ){
      // read the analog in value:
      tempSensorValue = analogRead(analogInPin0);                                        
      Serial.print("T");
      Serial.print(tempSensorValue);     
      Serial.print("-");
      humdSensorValue = analogRead(analogInPin1);       
      Serial.print("H");    
      Serial.print(tempSensorValue);   
      Serial.print("-");       
      cData++;              
  } 
  delay(1000);  
/*    if( Serial.available() > 0 )  {      
          char choice = (char)Serial.read();       
       __read_EEPROM();                      
        
   }  
  else
   {
     continue;
  } */

}

How to do something like that??

Attention: i'm reading for the 1st second 50 values, This is a continuesly job, because i create realtime graphs in C#, so i can't stop the values retrieving.

If I understand you correctly, you need to implement a protocol, with 2 messages. One message is for Temperature and Humidity, and the other is for the EEPROM memory. Currently you have a defined structure for your Temp+H, by adding T,-,H,- to the message, but you do not have any indication of EEPROM data. I would suggest to add E and - to the serial.print in the read_EEPROM function. Then you can move the if (serial.available) {...} clause to the inside of the while loop. On the computer side, you would need to decide if the message you are receiving is Temp + Humidity (Txx-Hxx-) or an EEPROM read result (Exx-) and process accordingly.

Your loop would look like this (and could be modified to just run forever):

while( cData <= 50 ){  //or change it to while (true) 
      // read the analog in value:
      tempSensorValue = analogRead(analogInPin0);                                        
      Serial.print("T");
      Serial.print(tempSensorValue);     
      Serial.print("-");
      humdSensorValue = analogRead(analogInPin1);       
      Serial.print("H");    
      Serial.print(tempSensorValue);   
      Serial.print("-");       
      cData++;     
      
      if( Serial.available() > 0 )  {      
          char choice = (char)Serial.read();       
       __read_EEPROM();                      
      }         
  }

Yeah i understand!
And thank you very much about it!