Lyndon,
I had to accomplish the same goal in my project. ?The way that I did it was use your sensor to tell the plc how fast you are going. ?To get your distance traveled used a custom function triggered say every tenth of a second and calculate how far you have gone, ie 5 mph in one thenth of a second = whatever, don't forget to scale up so you don't loose decimal data. ?In the same custom function add that value to a DM or if larger storage is needed use an A-Z to store the value. ?If you look at the code for the asphalt distributor in applications, I think the stuff I wrote would probably work for you. ?I had to do exactly what you are talking about on two inputs. ?Hope this helps.
Ken