LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

counter

For the last two weeks, we've attempted to have a 6035E board read a SIMPLE falling-edge signal.  However, the counter just keeps counting and counting, even using MAX.
 
I've used counters before, in fact, we've ensured that the encoder is operating properly by programming my PIC18F4550 to act as a counter.  Works as it should.
 
We are using DAQmx and can actually get the CTR0 to output a simple PWM signal to our H-Bridge.  What we want to do now is simply read the number of falling edges on CTR1.  Again, all it does is simply count up and won't stop.  
 
All the documenation we have found assumes that someone has in-depth knowledge of all the intricacies of DAQ internals talking about gates and sources and triggers, or worse still, is for LabView.  All documentation that's relevant always seems to be in LabView (or we get 404s).  I, for the life of me, can't see why even simple counting is incredibly difficult to create in LabWindows in DAQmx.
 
I assume one just creates a task, and uses the DAQmxReadCounterU32 () to read the counter assosiated with that task.
 
I have to say that programming for LabWindows has to be the most unfriendly and frustrating experience ever... and I was forced to learn Modula-2 at one time.  🙂 
0 Kudos
Message 1 of 2
(3,097 Views)
Patrick,

I empathize with the frustration you've experienced while setting up a counter task in CVI.  I'd like to point your attention to an example that ships with CVI entitled 'CntDigEv.prj.'  It actually demonstrates how to count digital events on a Counter Input Channel.  Edges are counted on the counter's default input terminal (refer to the I/O Connections Overview section in the example's description for more information), but could easily be modified to count edges on a PFI or RTSI line.

Let me know if you have any difficulty setting up the example or run into further problems.

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 2 of 2
(3,060 Views)