# Calling usrp\_source block function from other block

**URL:** <https://www.ruby-forum.com/t/calling-usrp-source-block-function-from-other-block/234229>\
**Category:** GNU Radio\
**Created:** [February 17, 2015, 5:53pm UTC](https://www.ruby-forum.com/t/calling-usrp-source-block-function-from-other-block/234229 "2015-02-17T17:53:58Z")\
**Posts on this page:** 3\
**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:** [February 17, 2015, 5:53pm UTC](https://www.ruby-forum.com/t/calling-usrp-source-block-function-from-other-block/234229/1 "2015-02-17T17:53:58Z")

</div>

Hi all,

I’m looking for the best way to retune the USRP from another block in a  
running flowgraph. I’ve seen the tune callback method used by  
bin\_statistics\_f, but I was wondering if there are other ways to do it.  
I took a look at message passing  
([http://gnuradio.org/doc/doxygen/page\_msg\_passing.html](http://gnuradio.org/doc/doxygen/page_msg_passing.html)), but I’m not  
sure how to bind usrp\_source’s set\_center\_freq to handle a freq passed  
by message, etc.

Are there any examples of doing this laying around or is  
bin\_statistics\_f’s tune callback still the best way to do it?

-Doug

---

<div class="post-metadata">

**Author:** ![AndersonS\_Douglas\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@AndersonS\_Douglas\_J](https://www.ruby-forum.com/u/AndersonS_Douglas_J)\
**Post date:** [February 17, 2015, 9:48pm UTC](https://www.ruby-forum.com/t/calling-usrp-source-block-function-from-other-block/234229/2 "2015-02-17T21:48:46Z")

</div>

On Tue, Feb 17, 2015 at 11:52 AM, Anderson, Douglas J. \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> Are there any examples of doing this laying around or is  
> bin\_statistics\_f’s tune callback still the best way to do it?
> 
> -Doug

Hi Doug,

Take a look at the UHD page:

> **[GNU Radio Manual and C++ API Reference: UHD Interface](https://www.gnuradio.org/doc/doxygen/page_uhd.html)**

The existing command message interface to the UHD block’s already allows  
you to set the frequency with a message. This manual page will tell you  
how  
to format that message properly.

Tom

---

<div class="post-metadata">

**Author:** ![AndersonS\_Douglas\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/53a042/32.png) [@AndersonS\_Douglas\_J](https://www.ruby-forum.com/u/AndersonS_Douglas_J)\
**Post date:** [February 18, 2015, 5:33pm UTC](https://www.ruby-forum.com/t/calling-usrp-source-block-function-from-other-block/234229/3 "2015-02-18T17:33:22Z")

</div>

Thanks Tom, that gives me a good starting point.

-Doug

* * *

From: removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid] on behalf of Tom  
Rondeau [removed\_email\_address@domain.invalid]  
Sent: Tuesday, February 17, 2015 1:47 PM  
To: Anderson, Douglas J.  
Cc: GNURadio D.ion List  
Subject: Re: [Discuss-gnuradio] Calling usrp\_source block function from  
other block

On Tue, Feb 17, 2015 at 11:52 AM, Anderson, Douglas J.  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Hi all,

I’m looking for the best way to retune the USRP from another block in a  
running flowgraph. I’ve seen the tune callback method used by  
bin\_statistics\_f, but I was wondering if there are other ways to do it.  
I took a look at message passing  
([http://gnuradio.org/doc/doxygen/page\_msg\_passing.html](http://gnuradio.org/doc/doxygen/page_msg_passing.html)), but I’m not  
sure how to bind usrp\_source’s set\_center\_freq to handle a freq passed  
by message, etc.

Are there any examples of doing this laying around or is  
bin\_statistics\_f’s tune callback still the best way to do it?

-Doug

Hi Doug,

Take a look at the UHD page:

[http://gnuradio.org/doc/doxygen/page\_uhd.html](http://gnuradio.org/doc/doxygen/page_uhd.html)

The existing command message interface to the UHD block’s already allows  
you to set the frequency with a message. This manual page will tell you  
how to format that message properly.

Tom
