First a thank you to the orginal coder for this probing macro and Dark Screen for Mach 3 (Josh Haywood).

This code by Josh has been modified by myself to function with english units. The problem I'm having and don't understand is why don't the code lines (highlighted in bold)slow the feed rate to 4 in/min when retracting Z by .5 inch? When the machine does retract it appears to do so as a rapid movement.

This macro is running within Mach 3 with an ethernet connection to Pokeys57 controller.

'-------------------
'Josh Haywood (modified by HKinkade) I'll Do It Myself XYZ Probe Macro
'To probe Z-
'https://www.youtube.com/illdoitmyself
'Note: This script is designed for english units e.g. inch
'-------------------
Dim PlateHeight As Double, FeedCurrent, ZPosCurrent As Double

'PlateHeight = getoemdro(1001) ' Get Plate Height (Mach3 Plate height)
PlateHeight = getoemdro(1151) ' Get Plate Height (Darkscreen PlateHeight)
FeedCurrent = GetOemDRO(818) 'Get the current settings

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Probe plate is grounded, check connection and try again)"
Else
' ###### Probe Z- ######-
ZPosCurrent = GetDro(2) 'Get current position
Code "F4" 'slow feed rate F4 in/min

Code "G31 Z" & (ZPosCurrent - 1) 'probe inch down
While GetOemLed (825) = 0
Sleep(1)
Wend

Sleep(250) 'Wait for DRO to update

Call SetDro (2, PlateHeight) 'Set the Dro

Sleep(250) 'Wait for DRO to update

Code "F4" 'slow feed rate F4 in/min
Code "G0 Z" & (GetDro(2) + Abs(.5)) 'Move off the plate .5"
While IsMoving()
Wend

Code "(Z Axis Zeroed for PlateHeight:" & PlateHeight & ")"
Code "F" & FeedCurrent 'Restore Feedrate
End If