convert a string from labview

hello,
i'm sending a string from Labview to arduino via xbee. the string is ascii representation of a number between 0 to 180. i read the serial port using serial.read to an integer. and i want to convert it back to a number. the problem is that if i use atoi(); it only converts the last number that represent only one digit sent. if i send 153, i get 49 53 51 and after atoi(); i get only 3. any ideas?

The problem is probably that you haven't received all the data when you start processing. If you need further help, post your code.