This is the macro code to monitor the Z slowdown switch. First you set up your inoput in mach (turn on ,set port/pin)
Then place this code inside the Macropump. It monitors the switch and IF it goes avtive setsets the RefSpeed if it is not active it reset the ref speed back to normal.
If Isactive(input1) Then ' Monitor input 1 IF the input goes active then
DoOemButton(1001) 'Feedhold
While IsMoving
Wend 'Wait until it stops
DoOemButton(1003) 'Stop
Setparam( "Zrefper",25) ' Set Ref speed to ()% of rapid
DoOemButton(1024) 'Restart Zref
Else
SetParam("Zrefper",50) 'IF the input does not go active then set Ref speed to 50% of rapid
End If
NOW as Hood mentioned you SHOULD be very conservative of your homing speeds with the Z as NOT to overrun the switch too far. The slowdown is a backup NOT a reason to overspeed the Zref function. Heck you only have 5" of travel anyway whats the hurry.
Hope that helps, (;-) TP