[USRP-users] Receiving samples with dealy at regular intervals

Rob Kossler rkossler at nd.edu
Wed Apr 15 10:27:02 EDT 2015


Hi Kamal,
Is it possible for you to use continuous streaming from the UHD driver and
then simply select the points you want to keep and the points you want to
discard using logic in your own software?  This may be superior to
starting/stopping streaming.
Rob

On Tue, Apr 14, 2015 at 9:56 AM, kamal kumar jeldi via USRP-users <
usrp-users at lists.ettus.com> wrote:

> Hi All,
>
> P.S : This is the contiguous mail to the mail with the same subject in the
> April,2015 threads. I am unable to get reply mail so happened to make it
> this way
>
> Hello Marcus,
>
> Thanks for your suggestion to use rx_timed_samples.cpp example code for
> receiving data samples with delay at regular intervals, Here I present the
> visual representation again,
>
> <--NRXP1-->  <--RXP--> <--NRXP-->  <--RXP--><--NRXP-->  <--RXP--> and so on
> |                     ||-------------||
> ||-------------||                    ||-------------| and so on
>
> Legends:
> NRXP1 : No receiving period with value less than NRXP
> NRXP : No receiving period
> RXP: receiving period
>
> stop receiving for 10us initially and then receive some 80 samples and
> from next on stop receiving for 22us and then receive 80 samples and go
> on...
>
> so after getting some inspiration form rx_timed_samples.cpp and
> rx_samples_to_file.cpp example code I came up with this code:
>
> bool stream_changed = false;
> uhd::stream_cmd_t
> stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPLES_AND_DONE)
> stream_cmd.num_samps = 80;
> stream_cmd.stream_now = false;
> stream_cmd.time_spec = uhd::time_spec_t(0,NRXP1,1000000);
> rx_stream->issue_stream_cmd(stream_cmd)
>
> while(condition to start loop)
> {
>
> rx_stream->recv(buffer_to_store,buffer_size,meta_data,timeout,as_packet);
>
>       if(!stream_changed)
>         {
>             std::cout << "Stream altered" << std::endl;
>             stream_cmd.time_spec = uhd::time_spec_t(0,22,1000000);
>             rx_stream->issue_stream_cmd(stream_cmd);
>             stream_changed = true;
>         }
>
>        //some error checking code on meta_data received from board
> }
>
> The above code compiles, but during runtime it throws with the following
> error:
>
>
> *Error: Receive error : ERROR_CODE_LATE_COMMAND*
>
> please help me.. Thanks in advance :)
>
>
>
> _______________________________________________
> USRP-users mailing list
> USRP-users at lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20150415/22254e9e/attachment-0002.html>


More information about the USRP-users mailing list