Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Externally controlled counter direction with USB-6211

I am using a USB-6211 and created a simple read counter application with the DAQ Assistant. It counts pulses (1 sample on demand) on Counter 0 (PFI0). When I set Direction to Externally Contolled it does not work properly. It counts random up and down. According to the manual my direction input line is Ctr 0 B (PFI1), but the level of this pin has no effect. What am I doing wrong?
0 Kudos
Message 1 of 5
(4,527 Views)

Hello Steffan,

According to the following Knowledge Base you have cannot use the default settings wehn trying to externaly control the direction of the counter:

http://digital.ni.com/public.nsf/allkb/1A8818274130FA388625722E00760CC9?OpenDocument

Since these changes cannot be done in the DAQ assistant you have to use the DAQmx API to resolve this. I have attached a small example that does a simple event count on the source pin of counter 0 (which is also the A input of the counter). With a property node I have set the Counter Direction input terminal to PFI 1 (which is the B input). Now when the PFI 1 is low you will count up, when it is high you will count down.

hope this helps,

Regards,

RikP - National Instruments Applications Engineering



Message Edited by RikP on 06-05-2008 10:12 AM
Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 2 of 5
(4,504 Views)
Thanks alot, that just solves it! I searched this forum but this KB article didn't cross my search path.
0 Kudos
Message 3 of 5
(4,501 Views)

Hi!
I have a similar problem, perhaps with a somewhat different solution.

 

I am using the NI myDAQ and I need to keep track of a rotating disc, using a counter. The direction of the spin is also important so I would like to use the externally controlled direction counter.

I tried the example attached here, thinking that my problems would be solved.

Unfortionately, this was not the case.

 

My symptoms using the above example are: The only allowed counter direction is up.

If I change direction to down or external; no difference.

If I stop the GUI and restart it when "Externally" or "Count Down" are chosen Error -200077 is presented

 

(Possible reason(s):

Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

Property: CI.CountEdges.Dir Requested Value: Count Down You Can Select: Count Up

Channel Name: myDAQ1/ctr0

Task Name: _unnamedTask<10>)

 

Any help to this matter will be much appreciated.

 

0 Kudos
Message 4 of 5
(3,743 Views)

Hello sumosimon,

 

It is unfortunately not possible to specify the count direction externaly on the NI myDAQ. So, you will not be able to run this example.

Cédric | NI Belgium
0 Kudos
Message 5 of 5
(3,701 Views)