how to read serial string

Hallo,

As I am working on data transfer from a adxl over xbee ( from adxl to processing is working)
I like to read the serial data in a arduino to have them for controling a steppermotor.
the format is 123,45,0,etc. for x,y,z, etc.
Howe to read the serial string in the arduino ? Then i want to make int from the data and use them.
Any suggestions are welcome.
Enclosed the script from the arduino board with adxl.

Theo

 int regAddress = 0x32;    //first axis-acceleration-data register on the ADXL345
  int x, y, z;
  
  readFrom(DEVICE, regAddress, TO_READ, buff); //read the acceleration data from the ADXL345
  
   //each axis reading comes in 10 bit resolution, ie 2 bytes.  Least Significat Byte first!!
   //thus we are converting both bytes in to one int
  x = (((int)buff[1]) << 8) | buff[0];   
  y = (((int)buff[3]) << 8) | buff[2];
  z = (((int)buff[5]) << 8) | buff[4];
  
  //we send the x y z values as a string to the serial port
  sprintf(str, "%d %d %d", x, y, z);  
  
  
  x = 0;                               // toegevoegd om x uit te schakelen???????
  y = 0;                               // toegevoegd om y uit te schakelen???????
  Serial.print(str);
  Serial.print(10, BYTE);
  
  //It appears that delay is needed in order not to clog the port
  delay(15);
}

Enclosed the script from the arduino board with adxl.

Not all of it.

What is an adxl? Do you have a link to the device you are connecting to the Arduino?

The device appears not to communicate with the Arduino using serial data. So, it is unclear what you are trying to do.

Serial data can be collected into a string or a String (strings are preferred). How to do that generally depends on knowing when a packet starts and when it ends.

I think ilioSS ment something like this

http://www.sparkfun.com/products/9045

A 3-axis accelerometer