I wanted a simple and safe tool touch off workflow that would be compatible with my normally closed (NC) touch-off device. It's an inexpensive mechanical unit from my friend Amazon. I found one of the shared macros (thanks Scott), but it had some extras I didn't think necessary, and one missing part I thought very important. That is, checking to make sure the touch-off device was connected and not accidentally or defectively in a tripped state. Now, you should know, this is my first macro, but I have what one may say is a fairly extensive programing background. However, I'm not sure that help, as the Centroid macro language is a bit of an odd duck. No offence, and I am sure it has lots of history, and engineering thought went into its design, but man it's a throwback to BASIC without all the good things BASIC has



There are some things to point out about the macro. It makes extensive use of the DEFINE statement. From a programing constructs perspective, there is much lacking in the macro language, but the DEFINE statement is one of the jewels, I don't see it used anywhere near it should, even the macros from Centroid. I don't know about you, but I don't think #4014 is very descriptive, and adding a comment everywhere a parameter is used to explain what #4014 is, just doesn't make sense. Ok, ok, off my soapbox.
Back to what is different about this macro. With a NC tool touch off device, you know if its connected, as you will see a high (set) input when its is connected and not tripped. Testing for this before moving forward with the actual touch-off, I propose is a safer workflow. The macro looks to see if a NC touch-off device has been configured, and if so checks as described. For a NO (normally open) device, no checks are performed. Have a look and use it if you like. I think I will be enhancing it more to use some of the other configuration parameters, like turning off validations, and not subtracting the height of the touch of device. Not sure when these are useful, but the Wizard give the option.
Last but not least, below is a video of the macro in action. Please let me know if you like it, or think I got something wrong. As I said it is my first.