Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling rate Real time pci7030/6040e

Hi Jeff B,

thanks for your quick reply, and it really help me to understand more of the concepts.

However does the buffer size affect the highest frequency attainable?
Or should the buffer size maintain at 1000?

I have actually upload my program under a reply.The program's name is known as error.

When you state 10[S/C], i understand that it is 10 sample per cycle. But for my program, the sample is enter as sample per second, which is the sampling rate.
How should i relate the 10[S/C] to unit of sample/s?

In my program, i have actually let the update rate equal to the sample rate so that the freq i enter will be exactly the freq the device output.

If i will to use your method, will the entered freq different form that which
will output?

Also, at a high update rate, i will not longer be able to change the attributes of my wavform on the fly?

Do you happen to know the reason?
Does this got to do with the buffer size?


Thanks for your help
0 Kudos
Message 11 of 12
(1,020 Views)
My first comment is a reiteration of something I previously stated. "Sample rate" and "Sampling rate" are terms used when dealing with analog INPUT. You are doing analog OUTPUT. When dealing with analog output, we use the term "update rate". This could be viewed as a triviality, but it has already caused one point of confusion, please let's try to be consistant.

While I did not mention it for simplicity sake, the buffer size does play a role as to how fast you can go. In fact, there is sort of an optimal range of buffer size, probably around 1000. If your buffer size is too small, too many small DMA transfers will be required. Your PC will fall behind and you will not be able to achieve even 500,000 S/s update rate.

The
[S/C] I spoke of corresponds to the waveform length in the Function Generator.vi you mentioned.

You will not be able to use the Function Generator.vi example as it was not designed to generate signals at the rates you are trying to achieve. It takes your waveform length (for a simple high-frequency square wave, let's say a waveform length of 2) and uses it for the buffer size, as well as the waveform data generated. What you need to use the optimal buffer size but still generate the proper data is to duplicate your data. So if you have two data points for your square wave, create an array of 1000 elements that are these two points repeated 500 times. Just remember that with buffered analog output, the first AO Write.vi should get an entire buffer worth of data, and each subsequent iteration should get a half a buffer's worth, in general, the first half followed by the second half.

I will not have time to look at your code or continue to follow up with this, but if you are st
ill having issues with this I would suggest contacting either the RT or DAQ support group at NI for further assistance if others on the message board do not answer your questions.
0 Kudos
Message 12 of 12
(1,020 Views)