OK,
Then here is a Macropump that will measure your True X Travel, (If you want you can add the Z so get a true sum, but I just used the X for distance).
Here is what you will need to do:
this macro will activate OUTPUT6 once the X axis travels more than 20,000mm, the output will stay on until the X Axis Travels more than 20100 when it passes that point, it will turn off OUTPUT6, and reset the counter to "0".
What you will have to do is caputre the output signal with an external relay, that turns on the oiler through a Timer or whatever, and then once the timer times out, it will Toggle your external relay to shut off the oiler signal, (even if it is still on in mach cause you havent yet moved the required 20100mm to shut it off, this is so your oiler just doesnt keep running if for some reason your X axis stops with the counter between 20000mm and 20100mm).
If you want, you can go into the MacroPump code here (and use the alternate statement as well), and do an "AND" statement with your timer sending back a signal on INPUT1 that shows it has timed out and finished timing.
Open Operator>Vb scripter and put the following script into the window, hit File>Saveas "macropump.m1s"
goto General turn on Macropump, goto general and in Ports and Pins make sure that OUTPUT6 and INPUT1 is enabled (you can change these I/O to your machine, but remember to change them in the macropump.
Here is the Macro:
'MacroPump.m1s
a=Abs(GetOEMDRO(83))
b=GetOEMDRO(806)
c=GetUserDRO(1400)
If a>0 And b=0 Then
c=c+a
SetUserDRO(1400, c)
End If
If c>20000 Then
ActivateSignal(OUTPUT6)
End If
If c>20100 Then
DeActivateSignal(OUTPUT6)
SetUserDRO(1400,0)
End If
'Alternat Last statement
'If c>20000 and IsActive(INPUT1) Then
'DeActivateSignal(OUTPUT6)
'SetUserDRO(1400,0)
'End If
'Enjoy,
'Scott