The information you get from your sensor is the position. To obtain the overall length of all the displacements (Distance) you have to :
1/ calculate the instant speed : make consecutive readings of the position at defined time intervals, and divide the difference between the positions (DeltaPos) by the DeltaT. The lower the DeltaT, the higher the sensitivity to tiny displacements, but also to signal noise...
2/ integrate the absolute value of speed over time.
Not difficult again : get the absolute value of the speed, multiply by the DeltaT (?!), then add to the previous distance to get the new one.
As you can see there is a kind of stupid operation here : division then multiplication by DeltaT. Well, if you don't need specifically the speed inform
ation, you can suppress this step and just calculate Sum(Abs(DeltaPos)).
The attached vi is an example of what you could do.
Does that help, or am I missing something ?
Chilly Charly (aka CC)