# How to receive message from subblock using topblock?

**URL:** <https://www.ruby-forum.com/t/how-to-receive-message-from-subblock-using-topblock/241648>\
**Category:** GNU Radio\
**Created:** [April 21, 2015, 7:10am UTC](https://www.ruby-forum.com/t/how-to-receive-message-from-subblock-using-topblock/241648 "2015-04-21T07:10:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [April 21, 2015, 7:10am UTC](https://www.ruby-forum.com/t/how-to-receive-message-from-subblock-using-topblock/241648/1 "2015-04-21T07:10:38Z")

</div>

Hi,

I’m newbie with PMT and I created a block was inherited from  
gr::sync\_block  
and sent out messages.  
Could you tell me how to receive messages from my block on topblock to  
process them, please?

With best regards,

LTP

---

<div class="post-metadata">

**Author:** ![Luong\_Tan\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3be4f8/32.png) [@Luong\_Tan\_P](https://www.ruby-forum.com/u/Luong_Tan_P)\
**Post date:** [April 21, 2015, 9:23am UTC](https://www.ruby-forum.com/t/how-to-receive-message-from-subblock-using-topblock/241648/2 "2015-04-21T09:23:24Z")

</div>

Dear LTP,

your top\_block [1] is a msg\_accepter, just like every other block in  
your system, and a basic\_block. Hence, it has a a post()[3] method, it  
has a message\_port\_register\_in()[4] etc.

You should be able to follow what’s described in the Guided tutorials,  
Part 5, section 5. [2] If you haven’t already, I strongly recommend  
reading Part 1-4 first – they are a fun read (I hope), and they explain  
a lot of the core concepts quite well.

Best regards,  
Marcus M?ller

[1] [GNU Radio Manual and C++ API Reference: gr::top\_block Class Reference](http://gnuradio.org/doc/doxygen/classgr_1_1top__block.html)  
[2] [https://gnuradio.org/redmine/projects/gnuradio/wiki/Guided\_Tutorials](https://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials)  
[3]  
[GNU Radio Manual and C++ API Reference: gr::msg\_accepter Class Reference](http://gnuradio.org/doc/doxygen/classgr_1_1msg__accepter.html#a03b0afcc820d3454d29f0ada3b89e2fc)  
[4]  
[GNU Radio Manual and C++ API Reference: gr::basic\_block Class Reference](http://gnuradio.org/doc/doxygen/classgr_1_1basic__block.html#a362b6de38292cca9c1d56439a6efad04)

---

<div class="post-metadata">

**Author:** ![Luong\_Tan\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/3be4f8/32.png) [@Luong\_Tan\_P](https://www.ruby-forum.com/u/Luong_Tan_P)\
**Post date:** [April 21, 2015, 4:14pm UTC](https://www.ruby-forum.com/t/how-to-receive-message-from-subblock-using-topblock/241648/3 "2015-04-21T16:14:59Z")

</div>

On Tue, Apr 21, 2015 at 3:21 AM, Marcus Müller  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

Adding to Marcus’ list of references:

[http://gnuradio.org/doc/doxygen/page\_msg\_passing.html](http://gnuradio.org/doc/doxygen/page_msg_passing.html)

Tom
