Help with understanding message pair to var
Hello All, I am writing a block that decodes metadata from an incoming stream and I would like the decoded metadata to be available to other downstream blocks. The best way to do this (I think) is to use the message passing functionality, My ultimate aim is to receive multiple metadata values via a single message from a c++ block and then to create a custom Python block which will parse the received message and set multiple variables. For reference I have been looking at the "message pair to var" block, but I am having trouble understanding exactly how the block updates the runtime variable. I think it has something to do with the callback line (self.callback(new_val)) here: https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/python/blocks/msg_pair_to_var.py and the template make statement here: https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/grc/blocks_msg_pair_to_var.block.yml. However, I am not 100% certain. Would someone be kind enough to explain to me exactly how the variable is set so I can determine how to write similar code that will update multiple variables. Thanks in advance! Kind Regards, Nik
Help is needed to connect the RFNoc block to the gnuradio blocks.
Hello, RFNoc block is built, and the FPGA image is flashed without errors. But, when I use the same RFNoc blocks in any designs and try to connect them with the gnuradio blocks, I am getting the connection error. Then, I tried to run example designs from the gr-ettus folder and faced the same problem. The grc image is attached for reference. All the block datatypes in the design (attached below) show a matching color, but still, there is a connection error. So, when I opened the blocks and checked, the datatype for the RFNoc block is "complex32 float and complex16 float," and the datatype for the "Throttle" and "QT GUI Time Sink" blocks is complex. Would that be a problem? If so, how do I correct this? Help is very much appreciated. rfnoc_dma_fifo.pdf Description: Adobe PDF document
Re: Help with understanding message pair to var
You've probably already found https://wiki.gnuradio.org/index.php/Message_Pair_to_Var For example, if samp_rate is the target variable, you end up with something like self.p2v = blocks.msg_pair_to_var(self.set_samp_rate) which will then call def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate self.thr.set_sample_rate(self.samp_rate) whenever a message is received. On Wed, Nov 23, 2022 at 3:43 AM Nik Ansell wrote: > Hello All, > > I am writing a block that decodes metadata from an incoming stream and I > would like the decoded metadata to be available to other downstream blocks. > The best way to do this (I think) is to use the message passing > functionality, > > My ultimate aim is to receive multiple metadata values via a single > message from a c++ block and then to create a custom Python block which > will parse the received message and set multiple variables. > > For reference I have been looking at the "message pair to var" block, but > I am having trouble understanding exactly how the block updates the runtime > variable. > > I think it has something to do with the callback line > (self.callback(new_val)) here: > https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/python/blocks/msg_pair_to_var.py > and the template make statement here: > https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/grc/blocks_msg_pair_to_var.block.yml. > However, I am not 100% certain. > > Would someone be kind enough to explain to me exactly how the variable is > set so I can determine how to write similar code that will update multiple > variables. Thanks in advance! > > Kind Regards, > Nik >
Re: QT GUI Label error in v 3.10.1.1
This looks like something that was fixed quite a while ago in https://github.com/gnuradio/gnuradio/pull/3301 Tested on a recent GR, and this doesn't happen. Could you post the generated code? On Tue, Nov 22, 2022 at 10:23 PM Jose Ruvalcaba wrote: > Hello, > > I've been noticing an issue popping out everytime I stop running my > flowgraph and I was wondering if someone had some insight on it. I have a > flowgraph where a signal source is connected to a probe signal block. This > block is constantly updating values and are being displayed using the QT > GUI Label block. However, after running my flowgraph for about 10 minutes I > get the following error: > > *Executing: /usr/bin/python3 -u > /home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py* > > *Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use > QT_QPA_PLATFORM=wayland to run on Wayland anyway.* > > *Exception in thread Thread-1 (_amp_probe):* > > *Traceback (most recent call last):* > > * File > "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", > line 150, in _amp_probe* > > *self.doc.add_next_tick_callback(functools.partial(self.set_amp,val))* > > * File "/usr/lib/python3/dist-packages/gnuradio/gr/hier_block2.py", line > 88, in __getattr__* > > *return getattr(self._impl, name)* > > *AttributeError: 'gnuradio.gr.gr_python.top_block_pb' object has no > attribute 'doc'* > > *During handling of the above exception, another exception occurred:* > > *Traceback (most recent call last):* > > * File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner* > > *self.run()* > > * File "/usr/lib/python3.10/threading.py", line 953, in run* > > *self._target(*self._args, **self._kwargs)* > > * File > "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", > line 152, in _amp_probe* > > *self.set_amp(val)* > > * File > "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", > line 182, in set_amp* > > *self.set_variable_qtgui_label_0(self.amp)* > > * File > "/home/spacerfvm/Documents/GNURadio_3.10_flowgraphs/func_probe_test.py", > line 189, in set_variable_qtgui_label_0* > > *Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label, > "setText", Qt.Q_ARG("QString", > str(self._variable_qtgui_label_0_formatter(self.variable_qtgui_label_0* > > *RuntimeError: wrapped C/C++ object of type QLabel has been deleted* > > > > It seems that my issue is related to the QT GUI Label block because when I > remove it and add say QT GUI Number sink, this issue doesn't appear. > > Has anyone experienced this issue? If so, would anyone be able to steer me > in the direction to fix it? I am currently running on Ubuntu 22.04 and am > running GNU RADIO 3.10.1.1 which I installed using sudo apt-get install. > I've also attached the flowgraph I am talking about. > > Thanks, > > Jose Ruvalcaba >