discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] change a block parameter using a python script


From: Marco Bosco
Subject: Re: [Discuss-gnuradio] change a block parameter using a python script
Date: Tue, 28 Jan 2014 18:21:56 +0000

It works! Thank you very much!

Marco.

-----Original Message-----
From: Josh Blum [mailto:address@hidden 
Sent: martedì 28 gennaio 2014 08.48
To: Marco Bosco; address@hidden
Subject: Re: [Discuss-gnuradio] change a block parameter using a python script



On 01/27/2014 11:19 PM, Marco Bosco wrote:
> Hi all!
> 
> I have a simple flowgraph: a signal source, a throttle and a waterfall 
> plot. I'd like to change the frequency of the signal source during 
> runtime using the output of a python script. The output of the python 
> script is time-varying, then I should see some variations in the plot 
> during runtime.  How can be this done? Is there a 'simple'
> way?
> 

Take a look at the XML RPC blocks in GRC.

If you are not using GRC, its still pretty simple to create an xml rpc server 
in python, and register the signal source's .set_frequency() parameter into the 
server. Then your python script that is performing the control can talk to the 
xml rpc client (it was a separate file from the flow graph, right?).

http://docs.python.org/2/library/simplexmlrpcserver.html
Its a pretty small number of lines to get working, and xmlrpc generally comes 
packaged with python. Good luck!

-josh

> Thanks
> 
> Marco
> 
> _______________________________________________ Discuss-gnuradio 
> mailing list address@hidden 
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]