Velocity calculation

Im using laser based distance measurement i want to calculate velocity how can i do

I went ahead and moved this to a new thread since it did not seem related to the old thread…

Can you share a little more information about your software?
Are you using PAC Control, Node-RED, Codesys or something else?

Lets start with that and we can see how best to help you after we know what you are using.

Since you are using Node-RED it will pretty much boil down to doing what you need in a function block with JavaScript.
I usually start with the Omni Calc and just convert it to Node-RED:

The velocity is the change of distance over the time step. In other words, the velocity is the derivative of distance (position). A thing to be aware of is that there is always going to be noise with your distance measurements and this can lead to large velocities that are just a result of noise over a small timestep. It is probably best to filter the velocity measurements with some type of moving average or IIR filter.