Hi Maheshkumar,
Here's some details on making a hierarchical block when using Gnuradio
Companion:
1. From an open GRC flow graph, mouse-select the connected elements that you
want to turn into a hierarchical block. The blocks and interconnect will turn
green.
2. Right click, then select Create Hier. This will create a new page. There
should be Pad Source(s) and/or Sink(s). These are the inputs and outputs of the
block,. GRC will provide default names like In, or Out. Double click the Pad
Source and edit the label to be something useful. These will be the names of
the inputs and outputs when any top_block uses your hierarchical block.
3. If some of the blocks in your hierarchical block have values set by
variables (like samp_rate) then those will become parameters in the
hierarchical block. If the same variable name was used for several different
blocks, you'll get duplicate parameter blocks, colored red (due to dupe
naming). For example, if 3 blocks in the hierarchical block all were set
by samp_rate, you'll get 3 parameters all with the same name. You would in
that case just delete two of those parameter blocks, and leave the variable
name in all three GRC blocks set at samp_rate. That parameter name is what
top_block sees when it passes something to your hiararchical block. You can
have multiple parameters, but the names must be different.
4. Double click the Options block. You may want to edit the Category to be
something other than Custom. This affects where the hierarchical block shows up
in the block selection menu in GRC. I for example, change it to something
appropriate to the function of the new hierarchical block, or leave it as
Custom. Also change the ID in the options block to a name that you want to use
for your new hierarchical block. This will be the name that is listed in the
block picker in GRC.
5. Click the button with the triangle/arrow/circle in
the GRC menu bar 'Generate the flow graph'. This will compile the hierarchical
block into python code and xml file, and place both files in the
~/.grc_gnuradio folder (hidden by default) in your home directory. It will also
ask you to save the GRC hierarchical flowgraph. This allows you to later edit
the hierarchical block, or look at it. I usually save it to the desktop, then
move it to ~/.grc_gnuradio later on when I'm happy with the block. Having all 3
files (.grc, .py, .xml) in the same folder makes it easier to keep track for
stuff (for me). Once you've created the .py and .xml files, you don't actually
need the .grc file, but I like to keep it around in case there is a need to
understand or change something later on.
You can edit the xml file if you wish with a text editor. For example, add
<doc> your docs can be spelled
out as text here
</doc>
tags to the xml to add documentation to your hierarchical block.
6. Close then restart GRC and your new hierarchical block should be available.
You can distribute your hierarchical block to others by giving them the 3 files.
-- Tom, N5EG
________________________________
From: Maheshkumar Pandit <elecomah...@gmail.com>
To: discuss-gnuradio@gnu.org; Thomas Rondeau <t...@trondeau.com>
Sent: Monday, February 3, 2014 9:13 AM
Subject: [Discuss-gnuradio] help me to design a hierarchical block
Hello every buddy...
i want to design my hierarchical block . I go through a
gnuradio tutorial but not success fully completed. can any buddy give mea
simplified example of any hierarchical block design ...
thank you for you time give for this query..
--
Thanks and regard:
MR.Maheshkumar Pandit
call @ 9662784649
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio