Questions related to msgq_insert

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 = gr.message_source(sizeof_char, 2)
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)
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)
i += 1

Really appreciate any of your help!
Thanks,
Yan

On Wed, Mar 02, 2011 at 09:18:39PM -0500, Yan N. 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 = gr.message_source(sizeof_char, 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
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


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

Dipl.-Ing. Martin B.
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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs