Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder Clk and Direction with BNC-2120 and 6251 M Series

I'm trying to measure the angular position using optical encoder connected to LS-7084. I have connected CLK to PFI3 on BNC-2120 and UP/DN to PFI4. I created two tasks using DAQmx. one task to get the direction and the other to get the counts. I have a problem with passing teh information from the first while loop to the count option on the second task. please advice. Thank You
0 Kudos
Message 1 of 3
(3,834 Views)

I don't have LV at my network PC and can't open your vi now, but can offer this:

There's a different method to configure your measurement with a single counter task so that the board's hardware accounts for the Direction bit.  To measure a Clock and Dir type of incremental position signal, you actually do *not* configure the counter to measure encoder position.  You configure it to count edges, and then use a DAQmx Channel property node to further specify that the count direction is controlled by the Dir signal found at PFI4.  The right property is probably found several sub-menus deep in the property hierarchy.

It'll definitely be better to let the hardware deal with this for you than to try to manage the complexity of two simultaneous tasks.

-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.
0 Kudos
Message 2 of 3
(3,824 Views)
CSUN,

Kevin is definitely on track. Please see KB 3Q48K1RM for the property node he is talking about. Knowing you have a BNC 2120 is very helpful, but what DAQ card do you have?
David L.
Systems Engineering
National Instruments
0 Kudos
Message 3 of 3
(3,816 Views)