LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicator stops updating

Hello,

 

I'm a beginner to labview and have a request. My VI seems to run fine and then partially hangs. I am asking if someone experienced could look at my VI and provide advice. Let me know if I'm breaking any "best principles" etc.

 

I'm trying to read rev/min of a shaft. For testing I run a motor (bench grinder with one metal tooth added) with Variable Reluctance Sensor pickup, signal conditioned through a LM2907 and further through a voltage comparator finally outputting a 0-5v square wave at ~59Hz. In time I would like to vary it from close to zero (~10hz) to up to 2kHz.

 

I have a SCB-68, and PCI-MIO-16XE-10 (PCI-6030E) and am using the counter to record the pulses in low frequency, single counter mode. I want to use this, rather than 2 counter mode, as the DAQ has 2 counters and I have 2 rpm's to eventually record.

 

After a varying amount of time the VI stops updating the gauge and frequency indicator but the real time box continues to update. Is there a problem with my VI? I am trying to sample the most recent buffered data point and the 49 before it to smooth the data. Maybe you can't multiply read buffer data points. If not could someone please provide guidance on how to properly perform this measurement. I'd prefer to update the display every 100ms so it is pleasing to the user.

 

Thanks in advance,

Chris

0 Kudos
Message 1 of 4
(2,297 Views)

Hi Chris

 

I don’t use the counter functions of DAQ, but if this were for analogue DAQ there is a conflict between the task set up and the timed loop which asks for 50 samples on each loop. The program will start to work at first, but over time the buffer will become full and you'll get problems. Also you probably don’t need to keep track of where the sample position is yourself, it should be handled by the DAQ read function.

Take a look at the modified diagram and give it a try.

 

Hope this helps, Ian

Message Edited by IanW on 03-09-2009 08:38 AM
Message Edited by IanW on 03-09-2009 08:40 AM
0 Kudos
Message 2 of 4
(2,276 Views)

Ian,

Thanks for the ideas, I'll try this later today to see how it works.

 

If I understand your VI, it will loop every 100ms and however many data points have been buffered by the counter will be read and averaged. If this is correct, then at low RPM's you will get an average of a few points and at large RPM's you will get an average of many data points.

If I desired measurements at <10Hz, would the timed loop wait for one data point?

 

It would be nice if I could average a minimum number of points to smooth the data and reduce bouncing of the gauge needle. I know it won't be the true current rpm but would only vary significantly at low and rapidly changing RPM's, which is not of a concern by me. 

 

Keep the ideas coming,

Thanks!

Chris

0 Kudos
Message 3 of 4
(2,259 Views)

Chris,

In that case you can replace the timed loop with a simple while loop, now put back your control for how many samples to average over. The period time of the loop will be determined by how many samples you collect.

 

Ian

0 Kudos
Message 4 of 4
(2,250 Views)