discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Writing a block in Python (+XML)


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Writing a block in Python (+XML)
Date: Thu, 30 Jan 2014 08:13:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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

Hi Tom,

> Have been trying to write a block in Python.  Did not use the
> modtool.py, since my understanding is it may not yet support that.
Luckily, you're wrong.
gr_modtool -l python add
works like a charm.

> The block has only one output, no inputs. Also wrote the
> corresponding XML file. the block shows up correctly in GRC when I
> select it and add it to the flowgraph.
It's a source :)
> I've defined the output signature in the work function ( 1, 1,
> gr.sizeof_float). My work function writes to output_items[0][ some
> indexes] and returns with a count of  the number of written output
> items.
very well :)

> Initially I derived the block from gr.block, but it complained
> about no connection to the output, so I changed it to derive from
> gr.hier_block2. When running the flowgraph with my block in it,
> gnuradio complains that there is no output connection inside my
> block.
Oh, that's wrong. A hier_block is a hierarchical block, that is, only
a set of connections between other blocks and maybe some logic.
You can't have "work" in a hier_block; well, you can, but it won't be
called by the GNU Radio scheduler.

> 
> Any advice?
A hier block can't be used here. I don't know about your flowgraph,
but: did you really connect your gr.block-subclass' output to let's
say a null sink or a vector sink?


My advice is: Use gr_modtool, it really makes life easier and failsafer.

Greetings,
Marcus

> 
> -- Tom, N5EG
> 
> 
> 
> _______________________________________________ Discuss-gnuradio
> mailing list address@hidden 
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS6fumAAoJEAFxB7BbsDrLQmMIAIEgeZgSM8UI8BfUyMnzoJWb
nc3oczsdrevBnprIsjAOfXgReU7gwYexASRBoEO4WFSsriVC5lf1bRMK6xRmbV+v
kaVvrGWurIHWrkt0NWtktwUc0oWWE1fUTvk146V1LR41nUg6vYIw9qMwM3rwf2zV
MeovU47+tsh3scyE9CEnGJxxiB7NGv7EaQ5EiuSXIFv+I8zrq/X2kFkX6K77oyhS
VUmVkOS4U+fYaMzk90Efk06ehm5yaRrrDQoZq0oNUeRTyLYzz7rLSmI2wPOvBYeW
uIhlHYTC0EYYmJy3WK+KggzhfUrw9yE547SkqUnKm2RFXxwfkzJqCwl0hsJ/Z/g=
=aQ50
-----END PGP SIGNATURE-----



reply via email to

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