discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Index Error: output_index < noutputs


From: Vasil Velichkov
Subject: Re: Index Error: output_index < noutputs
Date: Fri, 29 Sep 2023 16:55:20 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Hi Jim,

On 29/09/2023 05.00, Elmore Family wrote:
> If I am not properly instantiating the objects then I am very confused. I 
> don't understand how I could be creating an instance of the FT8_Receive block 
> outside of the flowgraph. 

In freq.py on line 64 you are calling the FT8_Receive class constructor.

64 RCV = FT8_Receive()

This basically create a new instance FT8_Receive class. Have a look in the 
python file generated by your top flowgraph (top_block.py), you would have 
something like

369         self.FT8_Receive_0 = FT8_Receive(
370             wave_select=0,
371         )

Here the first instance is created and later this instance gets connected to 
other blocks in your flowgraph.

384         self.connect((self.Receive, 2), (self.FT8_Receive_0, 0))

You can try adding a print statement in FT8_Receive constructor and check how 
many time it gets printed on your terminal.

> If this is the case, how do I create the proper instance?

I'm not sure how to pass a reference to this first instance of FT8_Recive to 
freq.py.

I'm usually using message ports when available in order to avoid tight coupling 
between blocks. The selector block has iindex port that you can use to change 
the input port, see https://wiki.gnuradio.org/index.php/Selector#Messages

Regards,
Vasil
 
> -----Original Message----- From: Vasil Velichkov
> Sent: Thursday, September 28, 2023 5:00 AM
> To: Elmore Family
> Cc: discuss-gnuradio@gnu.org
> Subject: Re: Index Error: output_index < noutputs
> 
> Hi Elmore,
> 
> On 28/09/2023 04.58, Elmore Family wrote:
>> I moved the Selector code (i.e. set_wave_select(wave_select)) into the 
>> portion of my code which runs after the flowgraph is running. I still get 
>> the same error.
> 
> Where did you moved it? Can you provide the modified source code?
> 
> Are you sure that you are calling set_wave_select() to the correct instance 
> of FT8_Receive block, that is actually part of your flowgraph?
> 
> Previously you were creating a new instance of FT8_Receive block that was not 
> part of any flowgraph and because of this it would never be run, the 
> check_topology() would never be called on this specific instance.
> 
> Regards,
> Vasil
> 




reply via email to

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