LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count digital pulses to trigger

Solved!
Go to solution

Hello all,

 

I have an optical encoder that generates a digital pulse for every 1 revolution of a motor. I am trying to construct a VI that will count these digital pulses and deliver an output pulse on the Nth count - where N is a user specified number of counts. I have seen a few similar examples of this online but am still unable to find exactly what I am looking for. Can anyone help with this? I am using a NI USB- 6009 DAQ device. 

 

Thanks. 

0 Kudos
Message 1 of 6
(3,524 Views)

Hi ciaran,

 

what pulse frequencies we are talking about?

 

The USB6009 has a counter, which is able to count (up) your pulses. You only need to check the current count with your limit to output a pulse on one of the DigOut pins.

 

When the frequency is rather low (<=50Hz) you can even use one of the DigIn pins to check for your pulse "manually"!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,517 Views)

Hello Gerd,

 

Thanks for your reply. My pulses vary depending on the angular velocity of the motor. The max RPM is approximately 6000, which corresponds to 100Hz. This would be the max pulse frequency that I would be counting. 

 

Ciaran

0 Kudos
Message 3 of 6
(3,513 Views)
Solution
Accepted by topic author ciaran2015

Hi Ciaran,

 

in this case I recommend to use the Counter of the USB6009.

Read the counter each 10ms to check the current count value…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,494 Views)

Hi Gerd,

 

Yes I'm using the counter pin on the USB6009. I can read and display the count number and generate an output pulse at a certain count number. What I need to do, and am struggling with, is generate a sequence of pulses at every Nth count. 

0 Kudos
Message 5 of 6
(3,463 Views)

Hi ciaran,

 

generate a sequence of pulses at every Nth count

Where do you struggle?

You can already output a single pulse on a digital output. What's the problem to output a series of pulses?

 

Remeber: the USB6009 is a very low-cost device, offering very limited possibilities. You can only use software timing when generating pulses, so there is no difference in generating a single pulse or a pulse train!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(3,460 Views)