See if the attached vi's help. I made a small modification to the same shipping example "Measure Buffered Position..." which peeks at the state of the A&B phase, then sets the Z-indexing to be sensitive to whatever combination was detected.
The method is to use a DIO Port Read and peek at the state of the bits corresponding to the A & B phases wired into the counter you specify for your encoder. NOTE: You can
NOT use counters 0 or 1 because their pins don't map to any of the 32 DIO. Your encoder will need to be wired to one of counters 2-7.
The vi I created to do this is called "Peek at A and B phases.vi" All the other vi's and controls in the attached llb can normally be found under your Labview directory at examples/daq/counter/n
i-tio.llb
One other note: The DIO port is configured for reading prior to configuring the encoder counter. I know some boards produce side effects when configuring the DIO port, but I don't know if the 6602 is one of them. I've just gotten into the habit of always configuring DIO first.
Good luck!
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.