09-05-2008 11:07 AM
Hello,
I want to increase the frequency performance for my period counter. I'm using a USB-6210 board and I have the vi that is attached - period measurement.
The problem is that I want to measure the period for a 8MHz signal (I know that is a lot, I would be happy even with 4MHz). The source freq for the counter is 80Hz. If the frequency is high, the accuracy is not very critical for me.
1. I get most of the time the error: "Buffer overwritten". I've seen that I can get rid of it if I decrease the frequency, but I don't want to do that :). I think that another solution would be to increase the number of points that are read. I noticed that the maximum buffer size is around 9000 points (I've read it with DAQmxRead Property Node).
2. Another fact that I've noticed is that in the While loop where I'm doing the Data Reading I should have no other operations or delay. Is this true, or just a coincidence?
3. There is a strange behavior: if I start the acquisition and I have at the input high frequency, I get the error (Buffer overwritten) almost instant. If I start acquisition at low freq I can increase it even at high freq.
4. There is another strange behavior: if the input frequency is high the frequency and the measured period increase and decrease togheter. I think that this is caused by alias. Where can I find some more information about the board limits?
If you can give me some other advice/hints/links/pdfs I would be very thanksful.
Maybe there are some small mistakes in the VI. I made it only to get a feeling of what I'm doing. I didn't chek it with the hardware.
Regards,
Paul
09-08-2008 03:36 AM
Hi Paul,
there is one thing that I don't understand: What is the 80 Hz signal that you are talking about? Do you want to measure the duration of each period of the 8 MHz signal or do you want to sample the period of this signal at a rate of 80 Hz? Could you please clarify this?
Thanks,
Jochen Klier
National Instruments
09-08-2008 04:06 AM
Hi Jochen,
Thank you for your replay.
Indeed, there is a mistake. The source frequency is 80MHz and not 80Hz.
What I want to do is to measure the duration of each period from a signal that can reach up to 8MHz. The source signal has the frequency of 80MHz.
Regards,
Paul
09-08-2008 04:43 AM
Paul,
that's clearly a spec that can't be reached with a USB-6210 in any case. Here are some benchmarks that show, that you shouldn't expect a higher sample rate for buffered counter measurements than about 1 MHz for a USB-621x device.
In fact I can't think of a counter device that reaches the required performance. One option might be the PCI-6602 board. This device could do a finite (not continuous!) buffered period measurement with up to 7 MHz. Other options are fast analog digitizers and an offline data analsysis.
Jochen
09-08-2008 06:55 AM
Jochen,
thanks for this information. This was what I was looking for some while.
I still have a question related to this topic: I've read that the maximum size of FIFO is 1024 samples. What does it mean?
This FIFO is the same with the: Available Samples Pro Channel from Read Property node? I've noticed that when the value for this property is passing 9000 I get the error with Overwritten Buffer. If it is like this why do I reach more than 9000 samples pro channel? Please take a look at the attachement (test1.png - screenshoot with the values / speed_test_x - the VI that I used for this measurement).
Which is the relation between maximum numbers of sample that can be read with the Counter 1D Read NSamples? In my VI there are N=250 samples. Can I increase it in order to avoid the error? If yes, which should be the maximum limit, 1024 ?
Paul
PS: I've hope that I translated the LabView terms in the right way. I have my LabView in german (but I don't know german, so it is a nightmare for me 😞 )
09-08-2008 08:34 AM
Paul,
I have added some comments to your answer.
Regards,
Jochen
KPanda wrote:
Jochen,
thanks for this information. This was what I was looking for some while.
I still have a question related to this topic: I've read that the maximum size of FIFO is 1024 samples. What does it mean?
[JK:] The FIFO is the hardware buffer on the board. In general the PCI-bus or the USB should have enough bandwidth to transfer the data as fast as they are acquired by the device, but in fact there are sometimes some latencies that require some local memory on the board. That's what is called FIFO in this context.
This FIFO is the same with the: Available Samples Pro Channel from Read Property node?
[JK:] No. This value refers to the buffer in the PC's memory that is allocated for the acquisition operation.
I've noticed that when the value for this property is passing 9000 I get the error with Overwritten Buffer. If it is like this why do I reach more than 9000 samples pro channel? Please take a look at the attachement (test1.png - screenshoot with the values / speed_test_x - the VI that I used for this measurement).
[JK:] The buffer size is not limited to 9000 values. NI-DAQmx allocates memory automatically by default. If you like you can increase the buffer size manually.
Which is the relation between maximum numbers of sample that can be read with the Counter 1D Read NSamples? In my VI there are N=250 samples. Can I increase it in order to avoid the error? If yes, which should be the maximum limit, 1024 ?
[JK:] You can increase the number of values to read up to the size of the buffer (not of the FIFO). A reasonable value is up to 50% of the buffer size, but this is not a strict rule. Anything between 10% and 90% could make sense, depending on the timing requirements of your application.
Paul
PS: I've hope that I translated the LabView terms in the right way. I have my LabView in german (but I don't know german, so it is a nightmare for me 😞 )
09-08-2008 02:12 PM
Jochen,
Thank you very much. Now everything is clear.
I want to give a rate to your messages but I don't know how to do it.
Regards,
Paul
09-09-2008 02:03 AM - edited 09-09-2008 02:04 AM
Paul,
rating messages should be quite easy. In the lower right corner of each post there are 5 check boxes that allow you to rate answers (1 star = very bad, 5 stars = very good).
Here is a screenshot:
Thanks and kind regards,
Jochen
P. S.: Most people are not very satisfied with the current rating system, so there will be some changes in the near future. This topic is discussed here.
09-09-2008 02:23 AM
Jochen,
sorry, but I don't have anything like that on my screen.
Paul
09-09-2008 02:27 AM
Paul,
that's due to the fact that you need at least 50 posts to become eligible for rating posts. Never mind. 3 or 4 more threads like this and you will become a full member of the community 🙂
Jochen