[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Flowgraph generates output even when the input ex
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Flowgraph generates output even when the input exhausts |
Date: |
Sat, 5 Dec 2009 06:54:58 -0800 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Thu, Dec 03, 2009 at 11:16:01AM -0600, Mir M. Ali wrote:
> Hi,
> I developed a gnuradio block that takes 2 inputs. Input_01 is coming from a
> source that repeats and Input_02 is coming from a source that exhausts after
> a while. The output should only be generated when there is data on both the
> input lines. I see in my flowgraph that even when the data on input_02
> exhausts output is still generated even though I see no problem with my C++
> code. Its a simple operation in which for each input in Input_02 line the
> block outputs 'N' items from Input_01. Once, the data source (in this case
> is a file_source in non-repeat mode) for Input_02 exhausts i.e. the file is
> read completely the output should stop being generated as there is nothing
> coming on Input_02. I expect the previous data stored in the buffer for
> Input_02 is flushed by the scheduler after one work() cycle.
>
> Any help would be appreciated.
> Thanks,
> Mir
GNU Radio does work the way you described. You can confirm this by
doing something like:
src1 = gr.vector_source_f((1,2,3,4,5,6), False)
src2 = gr.vector_source_f((10,11,12,13,14,15), True)
op = gr.add_ff()
dst = gr.vector_sink_f()
tb.connect(src1, (op, 0))
tb.connect(src2, (op, 1))
tb.connect(op, dst)
tb.run()
This will halt.
There is most likely a problem in your block. If you're subclassing
gr_block, are you calling consume or consume_each?
Eric