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$
  • $\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$ – Marcus Müller Oct 18 '17 at 10:34
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$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.