error in receiving string (one arduino to another arduino)

i wanna send string , actually three string , for that i am going to make combination of three string and than send that string to another arduino , but did not receive last part of string .

how can i fix it.

//sender code...

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);



float FloatVal = 1.009;
unsigned long IntVal = 1234567890;
char charVal[10];

String stringOne, stringTwo, stringThree;

//String FloatVal;
//String IntVal;

void setup() {
  
  Serial.begin(9600);
    mySerial.begin(9600);

  Serial.print("start");
  
  delay(1000);
        
       flowrate();
       Serial.print("StringOne:");Serial.println(stringOne);
       delay(1000);
       stringTwo+=String(IntVal);
       Serial.print("StringTwo:"); Serial.println(stringTwo);
       delay(1000);
       string
       
       Serial.print("StringThree:"); Serial.println(stringThree);
       delay(1000);
       
       mySerial.println(stringThree);
       
      // testing code, that the combination of string can be split in to required different strings or not

       Serial.print("floatval:");
       Serial.println(getStringPartByNr(stringThree, ',', 0));
       Serial.print("intVal:");
       Serial.println(getStringPartByNr(stringThree, ',',1));
       Serial.println(getStringPartByNr(stringThree,',',2));
  
  // put your setup code here, to run once:

}

void loop() {
 
       
    }
              
   float flowrate()
{
  dtostrf(FloatVal, 4, 3, charVal);
  Serial.print("charVal:");
  for ( int i = 0; i < sizeof(charVal);i++)
  {
    Serial.print(charVal[i]);
  }
  Serial.println();
  for(int i =0; i< sizeof(charVal); i++)
  {
    stringOne+= charVal[i];
  }
}
  
String getStringPartByNr( String data, char serarator, int index)
{
  int stringData = 0;
  String dataPart = "";
  
  for(int i = 0; i<data.length()-1; i++) {
    
    if ( data[i] == serarator) {
      
      stringData++;
    }
    else if(stringData == index) {
      dataPart.concat(data[i]);
    }
    else if (stringData > index) {
      return dataPart;
      break;
    }
  }
  return dataPart;
}
//receiving code..


 #include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3);

String inString = "";    // string to hold input
String inString1 = "";
String inString3 = "";
/****************      VARIABLES DECLARATION FOR timeremaining()     *********************/
unsigned long time_s;


float DATA=0.0;
String one = "";
String Stringone = "";

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  mySerial.begin(9600);
 

  // send an intro:
  Serial.println("\n\nString toInt():");
  Serial.println();
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // Read serial input:
  while (mySerial.available()) {
    
      int inChar = mySerial.read();
      if(inChar != '\n') {
        Stringone += (char)inChar;
        
      }
      else {
        Serial.print("input String:");
        one = Stringone;
        Serial.println(one);
        Stringone = "";
      }
  }
        
      
      
      //String one = mySerial.read();

      inString1 = getStringPartByNr(one, ',', 0);
      //Serial.println(getStringPartByNr(one, ',', 0));
      inString = getStringPartByNr(one,',',1);
      //Serial.println(getStringPartByNr(one, ',', 1));
      Serial.println(getStringPartByNr(one,',',2));
      
      DATA = inString1.toFloat();
      Serial.print("data:"); Serial.println(DATA);
      inString1 = "";
      
      time_s = inString.toInt();
      Serial.print("time:"); Serial.println(time_s);
      
    
 
}
  }
  

String getStringPartByNr( String data, char serarator, int index)
{
  int stringData = 0;
  String dataPart = "";
  
  for(int i = 0; i<data.length()-1; i++) {
    
    if ( data[i] == serarator) {
      
      stringData++;
    }
    else if(stringData == index) {
      dataPart.concat(data[i]);
    }
    else if (stringData > index) {
      return dataPart;
      break;
    }
  }
  return dataPart;
}

for that i am going to make combination of three string

Then, why are you using Strings?

Some code that has a snowball's chance in hell of compiling would be good.

There is no reason AT ALL to be f*king around with Strings (or strings) on the sending end. Serial.print() already handles the conversion of ANY kind of value to a string.

float flowrate()
{
  dtostrf(FloatVal, 4, 3, charVal);
  Serial.print("charVal:");
  for ( int i = 0; i < sizeof(charVal);i++)
  {
    Serial.print(charVal[i]);
  }
  Serial.println();
  for(int i =0; i< sizeof(charVal); i++)
  {
    stringOne+= charVal[i];
  }
}

You LIED! That function does NOT return a float.

hmm.. yes.. this function (flowrate()) did not return float, but ,..return a string.

I've used the below serial test code to communicate between two arduinos.

//zoomkat 3-5-12 simple delimited ',' string tx/rx 
//from serial port input (via serial monitor)
//and print result out serial port
//Connect the sending arduino rx pin to the receiving arduino rx pin. 
//Connect the arduino grounds together. 
//What is sent to the tx arduino is received on the rx arduino.
//Open serial monitor on both arduinos to test
//A diode between the slave tx and master rx is suggested 
//for isolation, with diode band attached to slave tx side. 
//

String readString;

void setup() {
  Serial.begin(9600);
  Serial.println("serial delimit test 1.0"); // so I can keep track of what is loaded
}

void loop() {

  //expect a string like wer,qwe rty,123 456,hyre kjhg,
  //or like hello world,who are you?,bye!,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >0) {
        Serial.print(readString); //prints string to serial port out
        Serial.println(','); //prints delimiting ","
        //do stuff with the captured readString 
        readString=""; //clears variable for new input
      }
    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}

i have to send three string to another send and than have to use that different string in some functions , how can i do that.?

Servo test code that receives and decodes the commands for specific servos. No help on the sending as I don't know what you want to send.

//zoomkat 11-22-12 simple delimited ',' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added 
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control 
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
        }
         readString=""; //clears variable for new input
      }
    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}

thanks for guide me , i got you ..i have to send string,

i have three string on one arduino , i am going to combine this three string and than send the new string which is combination of three string.

i have done this but at the receiving side i only got half string... this is my problem

hmm.. yes.. this function (flowrate()) did not return float, but ,..return a string.

No, it does not. It does NOT have a return statement, so it returns nothing. FIX THAT FIRST! Otherwise, you are wasting everyone's time.

i dont know much in this but i got this from here.

http://www.arduino-hacks.com/float-to-string-float-to-character-array-arduino/