Ok now that is working the way it's supposed to. I can set it to true and when I rotate the spindle manually it changes to false as soon as the slot in the index wheel passes through the opto coupler. Probably need to update the information in the link. Also the unlink command in the procedure needs to be corrected to unlinkp.
The G76 canned ngcgui routine runs fine as long as I have either phase A or phase B inverted.