LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 8 reset encoder

Hello, i have a PCI-6259. for which i would like to reset a counter value to 0. I cant seem to find any way to do this in Labview 8. Does anyone have any suggestions?. Any help is greatly appreciated. Thanks
 
Mike
0 Kudos
Message 1 of 4
(3,619 Views)

I assume you want a hardware signal to cause it to reset to 0?

The board *can* do it, but there are some non-trivial limitations.  Without more details about your app's needs, it's difficult to guess whether it'll do what *you* need.

Here's what you need to do to allow the value to reset to 0 based on a hw signal:

1. Configure the counter task for position encoding.

2. Enable the z-index reload feature, using 0 as the reload value.

3. Here's the catch: you must also predefine which 1 of the 4 possible A,B states is the one during which hw reset is allowed.  If you get a short reset pulse during a different combination of A,B, the pulse will be ignored and the count will not be reset.  There is NOT an option to "Don't Care" about the A,B state.

4. Here's a sometimes saving grace:  you can perform simple edge counting by calling the encoder a two-pulse encoder while hard-wiring the B input to Gnd.  Then A edges increment the count value just like edge counting would (assuming you specify the encoder units as "Ticks").  If your incoming signal is very low duty cycle (short high pulse, long low idle time), you can specify A,B state as Low/Low and have a good chance of catching the reset pulse.

5. You can also set the count value using software, but the task must first be stopped and then re-started after setting the count.  This can happen pretty quickly if you only stop and start rather than clear and recreate the task.

-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 4
(3,607 Views)
Thanks for the reply. I would like to do it in software. I dont mind stopping the task, but how do i reset the counter?.
Thanks
0 Kudos
Message 3 of 4
(3,600 Views)

You can set the count using a DAQmx property node, most likely a channel property node.  Once you navigate to select the Count property, you can right-click to toggle it to "write mode."  Then just wire in the count.

-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 4 of 4
(3,592 Views)