discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Tags in Embedded Python Blocks


From: Jeff Long
Subject: Re: Tags in Embedded Python Blocks
Date: Tue, 24 May 2022 20:37:55 -0400

An minimal example that shows this problem would be helpful. len(in0) and len(out0) may not be the same, so you could be reading tags for items you are not processing.

On Tue, May 24, 2022 at 1:34 PM Eli Baum <ebaum@mitre.org> wrote:

Hello,

 

We are implementing a custom Python block which reads an input stream and sends Messages when a certain Tag is seen. The message-passing component is working fine, but there seems to be an issue with the Tags.

 

The relevant work() function looks like this (based on the tutorial):

 

    def work(self, input_items, output_items):

        in0 = input_items[0]

        out = output_items[0]

       

        tags = self.get_tags_in_window(0, 0, len(in0))

        # ... process tags ...

        # ... send message ...

 

        out[:] = in0

        return len(out)

 

However, this only works for the first few tags. We’ll get around a dozen tags being returned by self.get_tags_in_window() in the first few calls to work(), and then nothing. However, with a Tag Debug block, we have confirmed that tags are in fact still being produced by the upstream block. (For our test file, we expect a few hundred tags total; all of the tags are of the same format.) Tags are even still propagating through the block (i.e. according to a Time Sink). But the python block itself can’t see them.

 

Using self.get_tags_in_range instead appears to work, interestingly – even though get_tags_in_window just calls get_tags_in_range under the hood.

 

Are we calling get_tags_in_window incorrectly? Or are there known issues with this function in python? This is on Mac OS 12.4, Gnuradio 3.9.3.

 

Thank you,

 

---

Eli Baum

Electrical Engineer

N231 Naval Enterprise & Sea Systems

The MITRE Corporation


reply via email to

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