# Tb.start(), tb.wait() or tb.stop() dows not work help

**URL:** <https://www.ruby-forum.com/t/tb-start-tb-wait-or-tb-stop-dows-not-work-help/236665>\
**Category:** GNU Radio\
**Created:** [September 24, 2013, 2:08am UTC](https://www.ruby-forum.com/t/tb-start-tb-wait-or-tb-stop-dows-not-work-help/236665 "2013-09-24T02:08:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 24, 2013, 2:08am UTC](https://www.ruby-forum.com/t/tb-start-tb-wait-or-tb-stop-dows-not-work-help/236665/1 "2013-09-24T02:08:44Z")

</div>

I am new to GNURADIO environment.

I want the flow graph that i am working with to turn ON and OFF with 5  
sec  
of interval.

I tried tb.start(), tb.wait(), tb.stop() and sleep(5).

But that is not working.

whenever I try to replace “tb.Run(True)” with any thing the program does  
not  
work.

Any suggestion will be greatly appreciated.

Thanks.

#####################  
if **name** == ‘ **main** ’:  
parser = OptionParser(option\_class=eng\_option, usage=“%prog:  
[options]”)  
(options, args) = parser.parse\_args()  
tb = RX\_ED\_FILE()  
tb.Run(True)

#####################

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/tb-start-tb-wait-or-tb-stop-dows-not-work-help-tp43791.html](http://gnuradio.4.n7.nabble.com/tb-start-tb-wait-or-tb-stop-dows-not-work-help-tp43791.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![shakib034](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@shakib034](https://www.ruby-forum.com/u/shakib034)\
**Post date:** [September 25, 2013, 6:58pm UTC](https://www.ruby-forum.com/t/tb-start-tb-wait-or-tb-stop-dows-not-work-help/236665/2 "2013-09-25T18:58:44Z")

</div>

On Mon, Sep 23, 2013 at 8:07 PM, shakib034 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> work.
> 
> Any suggestion will be greatly appreciated.
> 
> Thanks.

You probably don’t want to be toggling the flowgraph on and off  
constantly like this, anyways. That’s a very inexact way of handling  
it. You’ll want some kind of gating block that handles this more  
appropriately.

But regardless, you’re method for doing this wouldn’t work, anyways,  
since you have the order wrong. The start function is a non-blocking  
call that starts the flowgraph working. The wait is a blocking call  
that sits there and waits for the flowgraph to finish. In your code,  
you’re never getting past the wait stage. You’d want this instead:

tb.start()  
sleep(5) # Let the flowgraph run for some amount of time.  
tb.stop()  
tb.wait() # not really necessary, but makes sure the stop() call  
propagates to all blocks before moving on.  
sleep(5) # wait 5 seconds before doing anything (like in a while loop)

Like I said, this isn’t the best way to be accurate about how long  
things run and stop for, but it’ll get you in the right direction.

–  
Tom  
GRCon13 Oct. 1 - 4

> **[GNU Radio Conference 2013 — Rondeau Research](http://www.trondeau.com/gnu-radio-conference-2013)**
