Skip to content

Problems when passing messages to a source #3

@mikotaFull

Description

@mikotaFull

Good morning @jacobagilbert ,

I am writing to you because you solved the problem of someone in the issue https://github.com/gnuradio/gnuradio/issues/4239, and I am facing a pretty similar problem.

I want to generate a source controlled by voltage. Basically, I send messages to a source in order to change its amplitude.
I have built a block to generate messages and pass them to the source. To do so, I created an "embedded python block " and used part of the code of the " qa_python_message_passing.py " which is in the gnuradio's repository.

When I execute the graph in gnuradio I get the error : "File "/home/epy_block_0.py", line 29, in work self.msg_list.append(pmt.from_double(input_items[0][:]))
File "/usr/lib/python3/dist-packages/pmt/pmt_swig.py", line 1985, in from_double return _pmt_swig.from_double(x)
TypeError: in method 'from_double', argument 1 of type 'double'
thread[thread-per-block[4]: <block message generator(2)>]: SWIG director method error. Error detected when calling 'feval_ll.eval'"

I don't really understand what is wrong, why the pmt.from_double method doesn't work if the argument I'm passing is a double?
Please could you give me some guidance ? I am new to gnuradio and python, any help will be appreciated...
I attach the python code of the block (the message generator) and the GRC flowgraph.
thank you in advance.

GRCflowgraph
pythonCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions