Bytes skipped when using Arduino and Labview to read laser sensor data

Hi,

I'm using an Arduino Uno to read the analog voltage output of two laser sensors. I'm using these sensors to measure the width/diameter of an object.

The data from the sensors is collected via the analog pins in the arduino and sent to the computer via serial. The arduino program processes and calculates the width/diameter of the object. And I have succeeded in obtaining and displaying the width/diameter on Labview in a graph.

The problem I'm facing is that bytes are getting skipped, usually after running the program for 5 mins plus, and this affects the output on Labview. For example,

Object Width/ Diameter = 138
Object Width/ Diameter = 138
Object Width/ Diameter = 138
Object Width/ Diameter = 13
Object Width/ Diameter = 138
Object Width/ Diameter = 138

Notice the 13 in the middle (the 8 is missing). Is this happening due to the serial communication? Any suggestion on how to rectify this?

  • Sid