Hi Troy,
You are confusing me a bit with terms 'Z axis' and 'Z index'. Most encoders that support an index pulse often refer to the AB quadrature signals and the Index pulse as A B Z. This Z doesn't necessarily have anything to do with Z motor Axis.
Also you seem to be confusing 'Home Switch Inputs' with 'Index Pulse Inputs'. Index pulses can provide a very accurate means of determining absolute machine position, but they occur every encoder revolution and therefore are likely to occur at multiple machine positions without a means of knowing which one it is. So the normal method is to first move to a limit or home switch to know an approximate position and then move to find the first Index pulse. So 2 inputs are required one for the Limit/Home switch and one for the index pulse.
The IO 138 as parameter #4 in the SimpleHomeIndexFunctionTest.c example is for the Limit Bit. The #7 parameter in the example is set to -1 to indicate there is not any Index pulse available. Change this to your Differential Input. The 8 differential inputs on Kanalog J2 end up driving KFLOP Inputs 36-43
Code:
result = SimpleHomeIndexFunction(2, // axis number to home
1000.0, // speed to move toward home
-1, // direction to move toward home (+1 or -1)
138, // limit bit number to watch for
0, // limit polarity to wait for (1 or 0)
100.0, // speed to move while searching for index
-1, // index bit number to watch for (use -1 for none)
1, // index polarity to wait for (1 or 0)
5000); // amount to move inside limits
HTH