# How to stop the top\_block and restart signal transmission

**URL:** <https://www.ruby-forum.com/t/how-to-stop-the-top-block-and-restart-signal-transmission/203516>\
**Category:** GNU Radio\
**Created:** [February 22, 2011, 3:51am UTC](https://www.ruby-forum.com/t/how-to-stop-the-top-block-and-restart-signal-transmission/203516 "2011-02-22T03:51:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 22, 2011, 3:51am UTC](https://www.ruby-forum.com/t/how-to-stop-the-top-block-and-restart-signal-transmission/203516/1 "2011-02-22T03:51:29Z")

</div>

Dear all,

I’m trying to stop top\_block implementing the signal transmission for 5  
milliseconds and then restart the signal transmission at the transmitter  
side, by using the tb.stop() then time.sleep(0.005) to suspend the  
system for 5 milliseconds then tb.start() to start the signal  
transmission again. This approach gives an  
RuntimeError: top\_block::start: top block already running or wait() not  
called after previous stop().

Could you please help me to find what the problem is? I also tried  
lock() and unlock() which cannot stop the signal transmission  
implemented in top\_block.

the code that I use for data transmission is:

payload\_13bit = ‘\x01\x01\x01\x01\x01\x0’  
while(start\_flag == 1)  
msg\_13bit = gr.message\_from\_string(payload\_13bit)  
top\_block.\_ls\_msgq.insert\_tail(msg\_13bit)  
top\_block.stop()  
time.sleep(0.005)  
top\_block.start()  
top\_block.wait()

I will really appreciate any of suggestion on this problem.

Thanks,  
Yan

---

<div class="post-metadata">

**Author:** ![Yan\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/3e96dc/32.png) [@Yan\_N](https://www.ruby-forum.com/u/Yan_N)\
**Post date:** [February 22, 2011, 5:31am UTC](https://www.ruby-forum.com/t/how-to-stop-the-top-block-and-restart-signal-transmission/203516/2 "2011-02-22T05:31:24Z")

</div>

On Mon, Feb 21, 2011 at 9:50 PM, Yan N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> top\_block  
> Yan,  
> You want to use the lock() and unlock(). They should pause and unpause  
> the graph, so please elaborate when you say that they don’t stop the  
> signal transmission. The start and stop methods will definitely not  
> work here.

Tom
