1
$\begingroup$

I am a GNU Radio beginner, and I use the following code to make the block's output-port output a pmt data:

message_port_register_out(pmt::mp("fer"));
...   
int d_pdu=cnt_int;
pmt::pmt_t pdu = pmt::mp(d_pdu);
message_port_pub(pmt::mp("fer"),pdu);

And the "QT GUI Message Edit Box" only can show me that date in type 'int'. But I can't use it as an integer data. How to change its data type? Is there a block that can make pmt into int?

$\endgroup$
1
  • $\begingroup$ I'm surprised – the QT Gui Message Edit Box should be able to be set to different types, and is set to "String" by default. $\endgroup$ Oct 18, 2017 at 10:34

1 Answer 1

0
$\begingroup$

Well!I've made song changes on the Edit Box module. Let the Edit Box output pdu-type data. Code:

      float d_pda = pmt::to_float(d_msg);     
      pmt::pmt_t pda = pmt::cons(pmt::PMT_NIL, pmt::make_f32vector(8, 
      d_pda));
      message_port_pub(pmt::mp("msg"),pda);

Now I can use pdu_to_tagged_stream module to convert msg to float.And the float data can be shown in Number sink module.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .