From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading frequency inside a Timed Loop

In an application ( Win 7 + LV 2009 + PCI 6229 ) I am running a 10ms HW triggered Timed Loop. Inside this loop there are various machine control codes running. As part of the machine sequence I need to read a shaft RPM ( = 1450 rpm or about 25 Hz ) for 10 seconds and take the mean value. The rpm is picked up by a proximity switch and input as a digital pulse train.

 

If you refer the enclsoed VI, I have tried to explain the set up in a simple fashion. When ever I try to read the RPM the Timed Loop struggles to keep pace and I can actually see about 500ms as the iteration timing as againt the programmed 10ms . Have tried various values for Time Out of the counter.

 

So how exactly one handles this issue ?

 

Thanks. 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 2
(2,123 Views)

Hi,

 

I've taken a look at your VI, and these are my remarks

- FOR loop which is built into the loop is taking a lot of time.  In a timed loop of a Frequence of 1kHZ, you don't want to a little as possible.

- Further on you have declared no sample clock or what so ever.

- you can NEVER put a read VI in a case a turn it off, cause it will not stop the DAQ card from reading.  It will stop you VI from reading the buffer.  So the only thing you're going to get is a buffer overflow.

 

I've done some work on your VI, which I think you should give it a try 😉

 

CounterFrequence.png

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 2
(2,026 Views)