discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] questions related to msgq_insert


From: Yan Nie
Subject: Re: [Discuss-gnuradio] questions related to msgq_insert
Date: Thu, 03 Mar 2011 10:43:54 -0500

Really appreciate your reply, Martin. The msg that I need to send is 3315 byte long, which is the length of msg_13bit and of msg_stop as well. I changed the msg_limit of message_source to 6630, but this didn't changed the result. I expect to send msg_13bit once and msg_stop 50 times, but what I got is 10 times msg_13bit and 500 times msg_stop. I really wondering what the problem here, I only called the msgq_insert() function once, why it sends the msg 10 times? What  could be a good solution to this problem? How to decide the parameter, msg_limit, as it said this parameter represents the maximum number of the msg in msgq. I expected to send this msg_13bit as one msg and it takes time for the flow graph to really pop the msg to transmit,  which explains why I set msg_limit as 2. Is my understanding wrong? How to set the 

Really appreciate your help!
Yan

On 03/03/11, Martin Braun <address@hidden> wrote:
On Wed, Mar 02, 2011 at 09:18:39PM -0500, Yan Nie wrote:
> Dear all,
>
> I'm using the message_source to generate the source, connecting it with a multiply_const block to configure the amplitude for the signal. 
>
> The message_source is created by the following:
> data = "" 2)

This means your input items are 1 byte in length (=8 bit).

> msgq = data.msgq()
>
> When the msg is inserted as a tail of the msgq while the flow graph is running, the msg is inserted using insert_tail(msg). If my understanding serves me right, if only insert the msg once, it suppose to be send once. In my case, however, the msg is sent 10 times. (the set_amp is defined in the tb block to change the amplitude of the signal while tb is running) Could anyone help me to see what causes the problem?
> The code related msgq_insert in main thread is as followed:
> try:
>   while 1:
>            i = 1 
>            tb.set_amplitude(5000)
>            msg_13bit = gr.message_from_string(payload_13bit)

Is msg_13bit really only 8 bits large? Have you checked the message sent
is what you wanted it do be?



>            tb._ls.msgq.insert_tail(msg_13bit)
>            tb.set_amplitude(0)
>            while(i < 50)
>                    msg_stop = gr.message_from_string(payload_stop)
>                    tb._ls.msgq.insert_tail(msg_stop)

Same here.

>                    i += 1
>
> Really appreciate any of your help!
> Thanks,
> Yan

> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association


reply via email to

[Prev in Thread] Current Thread [Next in Thread]