Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Continuous frequency measurement~

Dear sir,

    How are you today?

    I tried to program the "Measure" in LabView 5.1 .  I've the simplified version
from "LabView Measurements Manual" in page 10-26. Basically, we want to measure the
frequency change within 20 ms (chirp). So I just naively added the "for loop" enclosing everything,
as the attached VI. But the testing result (please see the attached document) showed that
sometimes the counter/timer (AM9513) lost count. Could you please troubleshoot my VI and
tell me how I should improve?

    In addition, I tried to use the oscilloscope to see the gate signal from counter-1 (counter 5)
OUT pin, but it showed 0.14V. The signal from GATE pin of counter (counter 1) showed 5V.
I was expecting what I would see is something like TTL signals with different pulse widths and
delay widths. Can you tell me what I was doing wrong?

    Thank you for your previous answers!

Best regards,
0 Kudos
Message 1 of 8

Hi Margaret,

At this point, it is difficult to tell exactly what is causing the problem. Could you please answer the following questions so I could gain a better understanding of exactly what is going on?

1. Which hardware are you using to measure the frequency?
2. Were you able to get the original example program to run correctly before making the modifications?
3. How often do you notice the counter malfunctioning?
4. Which version of the DAQ driver are you using?
Hal L.
0 Kudos
Message 2 of 8
Dear Hal,

    1. We are using the multifunction DAQ board, AT-MIO-16F-5.
    2. Yes.
    3. After modifying the program.
    4. DAQ 6.1.

    Thank you for your precious answers.
0 Kudos
Message 3 of 8

Hi Margaret,

The for loop is not going to help you with the rates of the acquisition. I recommend going back to the original example program. With counters, the acquisition rate is going to depend how fast the while loop executes. You can use a couple of tick count functions to see how fast the while loop executes and apply that to your program. For example, you can have one tick count outside the loop connected to a shift register and one inside connected to another shift register and you can simply subtract the two values. However, this is not going to be 100% accurate. I would post an example of what this would look like, but you would not be able to open it in LabVIEW 5.1. Let me know if you would like a screenshot. I hope that you find this information helpful.

Hal L.

0 Kudos
Message 4 of 8
Dear Hal,

    I just realize that whenever I modified the program, it would lose count. But on the second day, it behaves normal.
One thing is that we need the counter to count continuously within 20 ms. We need the while loop takes as less time
as possible. I would be more than happy to see the screenshot and understand how fast the program can execute by
reprogramming it according to your diagram. This would be very helpful information. Thank you for your great assistance!

    Is there any  way that  we can reduce the execution time for the counter?

    Have a nice weekend!
0 Kudos
Message 5 of 8

Hi Margaret,

I think that there is one way to obtain a count every 20ms. What you will need to do is:

1. Generate a 50 Hz pulse train
2. Connect your signal to the a counter source
3. Connect the 50 Hz pulse train to the counter gate
4. You will obtain a series of counts over a 20ms period and you will be able to determine the frequency of the signal using post processing by dividing the count # by 0.02.

I noticed that you are using LabVIEW 5.1. This version of LabVIEW is no longer supported. I highly recommend upgrading to a newer version of LabVIEW. This will allow you to program with the DAQmx driver and creating your application with this driver would be significantly simpler and take a lot less time.

If you do not want to try this method, then I am attaching the screenshot for measuring the time the while loop takes to execute. I want you to know that the overall time will not have an effect measuring the signal's frequency. There really isn't anything you can do to decrease the execution time for the counter. I hope that you find this information helpful.

Hal L.

0 Kudos
Message 6 of 8
Hi! Hal,

    Thank you for your reply. I have a couple more questions.

    Is it possible to use DMA (direct memory access) to speed up the data acquisition?
In other words, is there any way to do by using DMA to make the counter count faster?
I'm using LabView 5.1.1, and the board, AT-MIO-16F-5.

    Second, do you have a more precise SubVI, instead of the Tick Count (ms), which
can count the time down to 0.1 ms?

    Thank you very much for your precious answers!


0 Kudos
Message 7 of 8

Hi Margaret,

As I've said before, the versions of LabVIEW and DAQ that you are using are no longer supported. I checked the AT-MIO-16F-5 specifications and you can use DMA transfers with this board. DMA is the default transfer method for the current DAQ drivers. So you would not have to change anything to use DMA transfers with the latest versions of LabVIEW and the DAQ drivers.

There is not VI that obtains more specific time than the tick The clock on the computer that the tick obtains the time from only has 1ms resolution. So, this isn't a limitation of the VI itself, but of the clock on the computer. I hope this helps.

Hal L.

0 Kudos
Message 8 of 8