Hello;
It's hard to figure out what is wrong with your code without seeing it.
However, you can try some tests to see if the problem is in the code or in the counter.
Configure bothe counters as simple event counter, and wire both encoder phases only to each counter source, and verify if the counter always starts at zero, and if the count values are making sense. I suggest you to grab a example code to execute the test (either from Labview or NI-DAQ shipping examples).
If everything goes as expected, I suggest you to use the example code as your start point for the development.
Hope this helps.
Filipe A.
Applications Engineer
National Instruments