Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with continuos period measurement

Hi all,
I am acquiring the 'W' signal from an alternator in order to measure its speed (a almost-square wave conditioned in order to be a ttl square wave). In a single round this signal has 12 periods, unfortunely not equal one to each other due to alternator construction.
For this reason, the speed calculated from measuring only one period of the signal is irregular, so I'm trying to acquire more periods and average their lenght in order to reduce irregularity.
I customized Measure Buffered Period.vi configuring the counter for continuos acquisition and adding a while loop to read the counter. I'm not involved in overlapping of data since the alternator runs at constant speed or with a very slow ramp.
The p
roblem is that after a certain number of iterations (not constant) Read Buffer VI states that the counter is always running and never stops counting.
I added a time-limit for acquisition and tried to catch the time out condition (warning code 10800 according to documentation) so to re-program the counter, without solving my problem.
During counting, I periodically read analog signals (AI Single Scan.vi) and status of inputs (DIO port Read.vi).
I'm using LV 6 with a PCI-6035E on Win98.
Anyone can suggest me some hint?
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 3
(4,794 Views)
OK, I managed it.
First I put a function generator instead of the real alternator but the situation doesn't change: the counter at some point remains in 'running' status with the time out condition on. So I simply reprogrammed the counter at this point (deleting the 'reset' icon I put before...). I added a led turned on when in time out condition and turned off in 'finished' condition.
Now the application runs ok, I simply see some times the led flashing, but all works well.
So the real question is: why the counters reaches time out even repeatidly counting even a regular square wave signal?
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(4,793 Views)
Hello Roberto,
The only reason I can think of that the 10800 warning code is occuring with the counter still running is that the counter is running OK, but hasn't accumulated the requested "number to read" counter entries yet. As a check, I would look at the Number Read indicator and the Number To Read control. You may want to modify the program so that the number to read is zero (this will just check to see how many have currently been read), then call Counter Buffer Read again to read this amount. This shouldn't be necissary, but it may help track down what is going on.
Also, I would suggest using the latest NI-DAQ driver, 6.9, if you aren't already.
0 Kudos
Message 3 of 3
(4,794 Views)