# Running Flowgraph some a certain period of time

**URL:** <https://www.ruby-forum.com/t/running-flowgraph-some-a-certain-period-of-time/239748>\
**Category:** GNU Radio\
**Created:** [March 12, 2014, 10:53pm UTC](https://www.ruby-forum.com/t/running-flowgraph-some-a-certain-period-of-time/239748 "2014-03-12T22:53:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [March 12, 2014, 10:53pm UTC](https://www.ruby-forum.com/t/running-flowgraph-some-a-certain-period-of-time/239748/1 "2014-03-12T22:53:46Z")

</div>

Hello GR,

- Is there a way how to run my flowgraph for a given number of  
minutes/seconds then stop it.

- I’d like to know too how to reconfigure my flowgraph (after I stop it  
from  
runtime) and resume its run after I changed for example the signal  
source at  
the begin of the flowgraph.

I tried:

My\_flowgraph Description

def MyRoutine(args):  
global tb  
.  
if (condition):  
tb.stop()  
myModifiedflowgraph.myModifiedflowgraph(args)  
.  
.  
.####.

if **name** == ‘ **main** ’:  
global tb  
.  
.  
threading.Timer(10,myRoutine).start()  
tb.Run(True)

My point here is that I need to run myModifiedflowgraph for a certain  
period  
of time then stop it and resume tb. FYI myModifiedflowgraph is the name  
of  
the other py script which contain the modifiedflowgraph called also  
myModifiedflowgraph.  
Any hints or explanations are well appreciated

Regards,  
Ruecan

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/Running-Flowgraph-some-a-certain-period-of-time-tp46919.html](http://gnuradio.4.n7.nabble.com/Running-Flowgraph-some-a-certain-period-of-time-tp46919.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![naeo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@naeo](https://www.ruby-forum.com/u/naeo)\
**Post date:** [March 13, 2014, 9:24am UTC](https://www.ruby-forum.com/t/running-flowgraph-some-a-certain-period-of-time/239748/2 "2014-03-13T09:24:58Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Hi Ruecan,

On 12.03.2014 22:52, Ruecan wrote:

> Hello GR,
> 
> - Is there a way how to run my flowgraph for a given number of  
> minutes/seconds then stop it.  
> Of course.  
> If what you really want to do is doing a certain number of samples,  
> the head block is what you need.

If your end condition really comes from outside, you should use  
something like topblock.start(), [wait 5s, e.g. using time.sleep()],  
toblock.stop(), topblock.wait()

> - I’d like to know too how to reconfigure my flowgraph (after I  
> stop it from runtime) and resume its run after I changed for  
> example the signal source at the begin of the flowgraph.

> My point here is that I need to run myModifiedflowgraph for a  
> certain period of time then stop it and resume tb. FYI  
> myModifiedflowgraph is the name of the other py script which  
> contain the modifiedflowgraph called also myModifiedflowgraph. Any  
> hints or explanations are well appreciated

This is not really reconfiguration, as far as I understand your  
architecture. It is stopping and starting two different flowgraphs -  
which is ok in theory, but you have to find a way to share the  
hardware between the two. Which usually defeats the purpose of having  
reconfigurable flowgraphs-adjusting your receiver structure to  
changing environment.  
In this case, it might be a good choide to disconnect() only the  
blocks in tb that need to be replaced and connect() the new ones.

Greetings,  
Marcus  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1  
Comment: Using GnuPG with Thunderbird - [http://www.enigmail.net/](http://www.enigmail.net/)

iQEcBAEBAgAGBQJTIWsRAAoJEBQ6EdjyzlHtq3gIAIfEwZNuSgL9iZxETuy1i8Wa  
9eAk5I2SQ2gyFSFKXlizeYTTZ9apCC81VD3fMYt8foYfVcEY+TL4orOFTUbrbeok  
VD6+T8/gLxErnYa37YiYXZBRjIX7SzFdrLt2eiUZBHMF0HDi4RJzJM594SBnDNyI  
OvqtY1pTcW+B4OEVS+BZgI/pj8zj6TrP+0Mg3JiyzKMoi4Yhvf3fcFQ9PXPmk7gW  
58lzl8GRFBi0Cexi9Q56pyaM1MqPJ0kflfz8rSydQjmS5b4HfuQk9VS6FT4P008e  
E0Vg0H71iNYXW83a0ZvbT9K5lXPvUdIGW/pQw9yY21OdqckKtezq64MzHQ6pwfc=  
=TSGr  
-----END PGP SIGNATURE-----
