Instead of using PFI36 and wiring it externally, you can do it internally by using ND_OTHER_GPCTR_OUTPUT. (Since you are using counters 0 and 1, the other counter is going to be 0 for 1 and 1 for 0.) (i.e. 0 and 1 are together, 2 and 3 are together and so on)
Instead of :
iStatus = GPCTR_Change_Parameter(iDevice, ulGpctrNum1, ND_GATE, ND_PFI_36);
try
iStatus = GPCTR_Change_Parameter(iDevice, ulGpctrNum1, ND_GATE, ND_OTHER_GPCTR_OUTPUT);
Let me know if this solves the problem.
Brian