Character limit?

dxw00d:

I never realized that the Serial port was that slow.

  Serial.begin(9600);

You could make it a lot faster.

I realize that, but the data set is coming from something that is sending it at 9600. I will however look into if I can speed that up, but the distance is about 50 feet unshielded so not sure how much faster I want/can push it without possible corruption.

This is what I have now,

// ****************************************************************
// File Name: 
// Version:
// Created By:
// Comments:
// ****************************************************************

// ********************** Version x.xx ****************************
// 03.11.12

// ********************** Consants ********************************
#define EOP        ';'
#define SERSIZ     25

// ********************** Included Libraries **********************
//#include <SoftwareSerial.h>

// ********************** Defaults ********************************
// ********************** Analog Input Pins ***********************
// ********************** PWM Output Pins *************************
// ********************** Digital Input Pins **********************
// ********************** Digital Output Pins *********************
// ********************** Output Pins *****************************
// ********************** Sensor Pins *****************************

// ********************** Variables *******************************
int i;
int c;
int Percent[4];
int iData[SERSIZ];
int iTemp = 0;

boolean PrintFlag = false;

int index = 0;

unsigned long startTime;

// ********************** Other Information ***********************

// ********************** Declorations ****************************
//SoftwareSerial LCDserial(7,8);

// ********************** SET UP **********************************
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  ///////////////////////// TO READ SERIAL ////////////////////////
  if(Serial.available())
    {
    ReadData();
    }
  
  if(PrintFlag)
    {
    for(i=0; i < SERSIZ; i++)
      {
      Serial.println(iData[i]);
      }
    PrintFlag = false;  
    }
}

// *********************** FUNCTIONS *******************************
// Read Incoming Data from Tank monitor
void ReadData()
{
  index = 0;
  iTemp = 0;
  c = 0;
  startTime = millis();
  
  while(c != EOP && millis() - startTime < 600) // Exit if EOP is not seen in less than 0.6 sec
    {
    c = Serial.read();
    if(c >= '0' && c <= '9')
      {
      iTemp = iTemp * 10 + (c - '0');
      }
    else if(c == ',') // Record Data and move to next index
      {
      iData[index] = iTemp;
      index++;
      iTemp = 0;
      }
    else if(c == EOP) // Record data and exit loop
      {
      iData[index] = iTemp;
      PrintFlag = true;
      break; 
      }
    }
}
// End ReadData()

And it appears to be working correctly. It will take incoming data like this;
244,23.5,100,23.6,456,345; (actual string is 24 numbers separated by commas ending in ; )
and record them as
iData[0] 244
iData[1] 235
iData[2] 100
iData[3] 236
etc

Now I can go back to work on what I am doing with this data in the main loop - which isn't much so a lot of time spent just trying to understand what the heck was going on. Gerrr. All well, what doesn't cause me to kill myself makes me stronger right? lol

Thanks everyone and if anyone sees anything else I can improve on - please feel free to point it out.