# Reset streaming vector/block

**URL:** <https://www.ruby-forum.com/t/reset-streaming-vector-block/222007>\
**Category:** GNU Radio\
**Created:** [August 9, 2012, 12:29am UTC](https://www.ruby-forum.com/t/reset-streaming-vector-block/222007 "2012-08-09T00:29:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 9, 2012, 12:29am UTC](https://www.ruby-forum.com/t/reset-streaming-vector-block/222007/1 "2012-08-09T00:29:01Z")

</div>

We have an application which uses the uhd.usrp.sink3 block, with  
io\_type.COMPLEX\_FLOAT32. The complex vector is converted from a  
text-based I-Q file. It is then sent to the sink with the assignment  
self.\_src = gr.vector\_source\_c(z, True).

As I understand the documentation, the Boolean True parameter means that  
USRP should continually/repeatedly re-transmit the same signal.

Transmission is started using tb.start(), time.sleep(1), and streaming=  
True statements.

Transmission (called “streaming”) is stopped with tb.stop() ,  
tb.wait(), tb.set\_vector(), and streaming=False statements.

(Note tb=my\_top\_block(), which is gr.top.block class).

1. Not sure why the time.sleep(1), or the tb.wait() statements are even  
necessary.

2. But more importantly, it seems that if we change the parameters which  
affect the vector (including the filename used as the source), the  
tb.set\_vector() statement seems to have no effect on the signal when  
transmission is resumed. It appears that once the vector has been sent  
to the USRP (once), it cannot be reset except by a complete re-start of  
the entire program/script. In other words, tb.stop is really tb.pause .

Is there a better way ? (Note: changing other parameters, such as  
preamp and gain, does have the proper effect. I surmise that the stream  
is buffered in USRP memory and cannotsimply be over-written. Is that  
true ?

George Kinal  
Lead Engineer  
MITRE E531 Signal Processing and Communications Analysis  
Phone (703) 983-7585

* * *

---

<div class="post-metadata">

**Author:** ![KinalS\_George\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/8baadc/32.png) [@KinalS\_George\_V](https://www.ruby-forum.com/u/KinalS_George_V)\
**Post date:** [August 9, 2012, 12:55am UTC](https://www.ruby-forum.com/t/reset-streaming-vector-block/222007/2 "2012-08-09T00:55:54Z")

</div>

On 08/08/2012 03:28 PM, Kinal, George V. wrote:

> Transmission (called “streaming”) is stopped with tb.stop() ,  
> tb.wait(), tb.set\_vector(), and streaming=False statements.
> 
> (Note tb=my\_top\_block(), which is gr.top.block class).

Basically, you do not want to use gnuradio like this. Starting and  
stopping the flow graph is not a practical thing. And vector source is  
really only for test purposes.

It sounds like you want to perform controlled sample bursts. For this,  
you will want to create a source block that produces the desired samples  
with metadata tags.

There is a good tags demo example to demonstrate this usage:  
[http://code.ettus.com/redmine/ettus/projects/uhd/wiki/GNU\_Radio\_UHD#Using-UHD-with-GNU-Radio](http://code.ettus.com/redmine/ettus/projects/uhd/wiki/GNU_Radio_UHD#Using-UHD-with-GNU-Radio)

And more about tags here:  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Stream-Tags](http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide#Stream-Tags)

-josh
