Thursday, May 4, 2017

Re: [Discuss-gnuradio] implementing message ports on an OOT module

EJ,

I made modifications to my C++ files and now GRC isn't complaining anymore!!!  Thank so much, that was a huge help.

Now I am trying to strobe some values into my block to make sure it is working, but I am not getting the results I expect.  So I believe that my block is expecting a PMT value with a name of "offset" and an integer value to follow.  What i tried to do in a Message Strobe block (as well as a Periodic Message Source), was to set the Message PMT to be:
pmt.cons(pmt.intern("offset"), pmt.to_pmt(10))

If I connect it to the print input of the Message Debug block, I see the output:
******* MESSAGE DEBUG PRINT ********
(offset . 10)
************************************

But I am not sure why there is a '.' in the middle there.  Is there some other way that I should be setting up the PMT message?

TIA!


On 05/03/2017 10:17 AM, EJ Kreinar wrote:
Hi Jason, 

I believe I have seen this issue when I did not register the message port correctly, or when names did not match between GRC and the message port name. 

You may need to modify the C++ code to add a message handler, if you have not already. Do you have a message port registered in your multiaperture_cpremoval block named 'msg'? Does this have a message handler? https://wiki.gnuradio.org/index.php/Guided_Tutorial_Programming_Topics#5.3.2_Adding_Message_Passing_to_the_Code

Hope this helps, 
EJ

On Wed, May 3, 2017 at 9:14 AM, Jason Matusiak <jason@gardettoengineering.com> wrote:
I had originally asked this question on the USRP site, but it was recommended by someone from Ettus to post over here since there is a chance it is more of a GNURadio issue than USRP.

I am attempting to create an RFNoC block for the X310 and it works fine.  I then wanted to add a message port to the block to pass variable into it.  The message port shows up in GRC and the flowgraph runs fine as long as I leave the message port disconnected.  Once I try to connect something to it, I see the following error:
Could not find port: msg in:
rfnoc
system

Traceback (most recent call last):
  File "/home/jmat/rfnoc-multiaperture/examples/CPremoval.py", line 253, in <module>
    main()
  File "/home/jmat/rfnoc-multiaperture/examples/CPremoval.py", line 241, in main
    tb = top_block_cls()
  File "/home/jmat/rfnoc-multiaperture/examples/CPremoval.py", line 196, in __init__
    self.msg_connect((self.foo_periodic_msg_source_0, 'out'), (self.multiaperture_cpremoval_0, 'msg'))
  File "/home/jmat/rfnoc/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 59, in wrapped
    func(self, src.to_basic_block(), srcport, dst.to_basic_block(), dstport)
  File "/home/jmat/rfnoc/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 131, in msg_connect
    self.primitive_msg_connect(*args)
  File "/home/jmat/rfnoc/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py", line 3489, in primitive_msg_connect
    return _runtime_swig.top_block_sptr_primitive_msg_connect(self, *args)
RuntimeError: invalid msg port in connect() or disconnect()

>>> Done


I can't for the life of me figure out what GR "could not find."  I see other people with similar posts in the past, but I never found a good resolution.

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


No comments:

Post a Comment