5000-57000 will give negative number

Maybe you want to use ABS(5000-LC)

so:

Code:
a=abs(5000-LC)
a=a min 5000
Pause a
might help?

But then I am not very sure about the maths to calculate the needed delay.

Ioannis