It's a bit complex, but LabVIEW has an example (Encoder Example) that spells out all that you need to setup. It assumes a digital quad encoder, so a different type, such as a single or an analog one that came in the KOP with the magnets, would be handled differently.
From the Getting Started window select "More..." at the bottom right under Examples.
Then select "Encoder Example"
Open up the Block diagram and you can copy/paste the code over to your project.
It breaks down like this:
Begin.vi
- DIO Opens for two channels (assuming a quad encoder like the KOP US Digital ones)
- Convert to Digital Source
- Encoder Open
- Encoder Config Timer
- Encoder Start
- Encoder Refnum
Autonomous Independent.vi
- Encoder refnum
- Encoder Get
Finish.vi
Checkout
http://www.usdigital.com/first for the encoder assembly guide.