From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

Some questions about USRP-2920(write data and fetch data).

Solved!
Go to solution

Taking the VI as refference,i have some questions about USRP.

1.In the NI USRP write tx data.vi,what is the function of timeout input? help of timeout is not so clear for me.

2.By using NI USRP write tx data.vi,the PC can write data generated by PC to a buffer,the buffer is in the RAM of PC or the USRP onboard buffer?what is the maximum number of samples the buffer can store? what will happen if the waveformsize is larger than the maximum size of the buffer?

3. Setting IQ rate to 200k and waveformsize to 10000,the PC can write 10000 samples per loop,but it also exists time delay between the two write,i want to know how the NI USRP write tx data.vi keep the continuity between the first 10000 samples and the second 10000 samples? When were the new 10000 samples written to the buffer?when the previous 10000samples was all sent out(tx buffer is empty) of some other situations?

4.I tried to put a time-delay(more than 0.05s) into the while-loop,run,then an error happened:tx buffer underflow,i want to know why the error could happen , how and by what the NI USRP write tx data.vi  detected the tx buffer  underflow?

 

Thanks for your attention to my questions!

0 Kudos
Message 1 of 6
(4,332 Views)

Actually, I have a similar question that in the example design, it use a for/while loop to fetch data, what if the data I ask per loop is smaller/bigger than the data stored in buffer? How can I get data stream continuesly without any message loss? The same question happened to write data just like you.

 

Did you get any answer about it?

0 Kudos
Message 2 of 6
(4,201 Views)
Solution
Accepted by topic author guigui004

I'll try to answer your questions as best I can:

 

1. The timeout is how long the PC will wait to transfer the samples to the device.  Usually you will not need to change this from its default value (10 seconds) unless you are using a low IQ rate or sending a large number of samples per VI call.

 

2. When you use Write Tx Data.vi, sample are copied from the PC memory to a buffer onboard the USRP device.  The maximum size of this buffer varies between driver version and device, but it is typically very large (on the order of millions of samples).  

 

3. Samples are continusouly streamed at the IQ rate you configured. As you send more data, it is appended to the current buffer and streamed immediately after the previous set of samples received has finished streaming. The samples are written to the device buffer immediately upon calling Write Tx Data.vi, but the VI will wait if the device buffer is full.  When the VI is complete, you know that all samples have been written to the device buffer

 

If at any time the device buffer no longer has samples, it will report an error the PC and you will see a "tx buffer underflow" error.  This indicates that you are not streaming samples to the device fast enough to keep up with the IQ rate you have set.

 

4. Introducing a time delay will cause the PC to wait before sending more samples to the device.  If you are not sending samples faster than the IQ rate you have set, you will see a "tx buffer underflow" error.

Message 3 of 6
(4,199 Views)

Now mingway, to answer your questions:

 

RX is different than TX, but still fairly similar.

 

During RX, received samples are written to a device buffer at the IQ rate you have configured.  When you call fetch, the VI will transfer the specified number of samples from the device buffer to PC memory.  If there are not enough samples in the device buffer, the VI will wait.  If the buffer at any time overruns, you will see a "rx buffer overrun" error.

 

If you are seeing overrun errors, you should:

1. Consider reducing your IQ rate to a rate which your PC can keep up.

2. Increase the rate at which you are fetching samples by increasing the rate at which the while loop can run

3. If you are doing processing of the samples on the PC, you should consider either discarding samples intermittently, or performing these operations in parallel with a fetch (so they do not block subsequent fetch calls).

 

The main goal of all of these is increasing the rate at which your PC can Fetch samples from the device.

Message 4 of 6
(4,197 Views)

Please see the third message of the topic option,thanks for your attention!

0 Kudos
Message 5 of 6
(4,178 Views)

First,many many thanks to you!

You gave me a lot help.By the way,could you please tell me what do you study using NI USRP 2920?

0 Kudos
Message 6 of 6
(4,177 Views)