Strange result when using message_sink and msg.queue

Hi all,

I’m now trying to use message_sink and msg_queue to receive data from
USRP.
And I’m having a problem that I cannot figure out. Please tell me where
I am
wrong.

####top block:

self.source = uhd.usrp_source(device_addr="",
stream_args=uhd.stream_args(‘fc32’, ‘sc16’, args=“scalar=1024”))

self.source.set_samp_rate(4e5)

self.queue = gr.msg_queue()

self.sink = gr.message_sink(gr.sizeof_float*2, self.queue, False) #what
does
True and False mean here?

self.connect(self.source, self.sink)

###top block

if name==“main”:

tb = probe_this()

tb.start()

while True:

          sleep(1)

    count = tb.queue.count()

          print count

          if count>0:

              msg = tb.queue.delete_head()

              print msg.arg1(), msg.arg2(), msg.length()

The result is like this:

8090

8.0 2172.0 17376

16309

8.0 362.0 2896

24536

8.0 724.0 5792

32724

8.0 362.0 2896

40906

8.0 362.0 2896

49133

8.0 362.0 2896

57362

8.0 724.0 5792

65574

8.0 362.0 2896

73798

8.0 362.0 2896

81997

8.0 362.0 2896

90221

8.0 724.0 5792

98433

8.0 362.0 2896

106643

8.0 362.0 2896

114872

8.0 362.0 2896

123094

8.0 724.0 5792

131263

8.0 362.0 2896

139448

8.0 724.0 5792

147621

8.0 362.0 2896

155840

8.0 724.0 5792

164050

8.0 362.0 2896

It seems that the number of data in each message is limited. I hope the
number can be much larger, say, 4e5 data in one message, so that each
message can hold the data of one second.

Anyone can tell me where is the problem and what should I do about it?

Thanks.

Wu

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