reset() should work _before_ the Head block reaches the specified items,
but once it reaches that number of items, Head is done and the flowgraph
will terminate. So, I don't think reset() will do what you're hoping.

Also, the code you posted creates a _new_ Head block each time through the
while loop and resets that block. You would want to operate on the Head
block in your flowgraph.

On Sat, Aug 5, 2023 at 12:45 PM Elmore's <wa4...@comcast.net> wrote:

> I am trying to reset a Head block so that I can resume streaming after
> receiving 180,000 samples. I had previously posted “Incompatible Function
> Arguments” related to this question but I seem to have resolved that issue.
> The following code – a callback – shows what I am attempting to do but it
> is not re-setting. The streaming never resumes.
>
> Is there more I need to do other than the reset? The Head block is in a
> Hier Block. Is this a complicating factor?
>
>
>
> from gnuradio import blocks
>
> def rx(stop_rx):
>         while not stop_rx.isSet():
>             print("\nStarting RX")
>             check_time(rx_cycle)
>             parse_rx()
>             time.sleep(8)
>             blocks_head_0 = blocks.head(gr.sizeof_float*1, 12000*15)
>             blocks_head_0.reset()
>             print("\nExiting RX")
>
>
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> Virus-free.www.avg.com
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> <#m_-2704811307418468573_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>

Reply via email to