LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ missing pulses

I am using the DAQ assistant to collect pulses from an encoder that is attached to a motor. I need to know how many pulses there were in the last x seconds and the total number of pulses. I am doing this using the elapsed time function. This is working well to get the pulses in the last x seconds. To get the total number of pulses, I have a case/loop structure set up to add each set of pulses from each x seconds that pass. The problem is that it is skipping pulses. For example, when x=1.5, it collects roughly 950 pulses per revolution when it should be 1000. Let me know if you have any ideas that could help me. Thanks.

0 Kudos
Message 1 of 8
(4,212 Views)

First things first, I think everyone else in these forums will tell you the same: get rid of the dreaded DAQ assistant and the dynamic data wire. Second, what Hardware are you using to do the counting? Also have you considered to just use a shift register to add up the pulses, without any further operations? Just add previous value to newly acquired one, simple enough.

0 Kudos
Message 2 of 8
(4,204 Views)

[I think I may have "invented" the phrase "The Dreaded DAQ Assistant", but otherwise I completely agree with Daikataro ...]

 

Bob Schor

0 Kudos
Message 3 of 8
(4,191 Views)

Daikataro,

 

How can I remove the DAQ assistant??

I am using an NI USB 6363 and incremental encoders.

I will see if simplifying the shift register part does the trick.

 

Thank you for your input!

0 Kudos
Message 4 of 8
(4,181 Views)

The DAQ assistant IS useful for one thing: quickly and easily creating the otherwise tedious channel startup SubVI. Right click on your DAQ assistant and you will see an option called "generate DAQmx code", which will turn it into code that used the DAQmx pallete functions, instead of the "black box" setup. I usually just create the task with the DAQ assistant, then turn to code so it saved me the hassle of creating each virtual channel individually, but still won't mess my code up.

0 Kudos
Message 5 of 8
(4,171 Views)

How is it different then? What changes?

0 Kudos
Message 6 of 8
(4,166 Views)

A myriad of things, too populous to explain, plus I'm certain there is an explanation in these forums way more detailed than anything I could whip up. But the basics is that you can control stuff like data format, no longer have that dynamic wire thing, can set up multiple read parts for different data outputs and get the info in a more readable format, such as a 2D array of doubles, which is great for datalogging. Plus you can configure the read to output just a single number, which you can easily use to increment the shift register AND calculation purposes.

Message 7 of 8
(4,161 Views)

Matter of fact I'm working on a similar case, and have developed a very basic VI to count how many pulses total AND how many pulses per second, with a card that doesn't have a built-in frequency counter (6009). Since I don't require pinpoint acuraccy, a bit of error is allowed. You can build from there.

0 Kudos
Message 8 of 8
(4,152 Views)