I am trying to redo my tool probe macro to be a little bit safer and more efficient so I have a sensor above my plate to tell the machine to slow down when it arrives there. I could probe at 3 IPM from max Z height but that would take forever. The idea, since tool length will always be different, is to have the tool trip the sensor some distance above the plate and then the feed rate will change from rapid to the appropriate rate for probing. This is the relevant portion; copied from another guy:

I need something like "when pin 9 goes high, exec.Code("F10");" or something. Basically emulating the speed override input on the run page. I want to crank the speed down to like 2% of normal once that input goes high (therefore the tool tip is about an inch above the probe plate).

Is that possible? I've been staring at the manual but so far I haven't come up with anything.

}exec.Code("G91 Z-0.25 F10");exec.Code("G90"); exec.Code("G31 Z" + Zmin + "F" + FeedrateSlow); // Do the Z probing again with Slow Feedrate to get a more accurate readingwhile(exec.IsMoving()){}

I move the Z axis down 1 inch then do a loop where it moves 0.75 inches down and checks the sensor. If it doesn't see anything it will move down 0.75 inches again and so on - until it reaches 24 iterations of 0.75 inch moves. If it sees that the sensor is triggered, it will set the 'a' variable to 25 (above the loop limit) which exits the loop on the next go-around. It then moves down 0.25 inches to get a bit closer to the touch plate and then does the probing routine from that point.

It's obviously a jerky operation having all of those steps and checking the sensor. If there is a way to do it smoothly, I'd love to hear about it!