TutorialsUsingMessageBlocksPython

From GNU Radio
Revision as of 14:32, 13 March 2017 by Wgebers (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using Message Sinks and piping data to Python

Don't use vector sinks

Seriously, that's not what they were made for. Don't use them.

How to do it: message sinks and sources

Messages provide a method to pass data from the Python domain into the flow graph, or C++ domain, and vice versa. This is useful if you have a flow graph that does some heavy lifting signal processing, and have some simple Python-based post-processing. Some of the graphical sinks use this feature; the data is generated in C++ and then passed to Python which in turn runs the display code.

msg-sink.png

This figure illustrates how it works. A message sink is a sink in a flow graph sense. Any data piped into the message sink is then packed into a message. This message can be fetched from outside the flow graph. Conversely, a message source may be used to inject data into a running flow graph, however it is not easily possible to specify the timing.