After a few hours of trying this and that and reading schematics and searching for clues......tada....
The encoder inputs pins "B" and "N" can be used as limit switches.
Use the SAP Set Axis Parameter TMCL command for parameters 12 and 13 to a "1" to enable the limit switch function.
Then connect the B and N encoder input pins to +5V through a pullup resistor. When the pins are switched to ground, the motor will be allowed to turn.
You can read the pin status using the GAP Get Axis Parameter command for parameters 10 and 11