Cool, thanks! Will try that out soon.

On Wed, May 24, 2017 at 12:34 AM Moritz Luca Schmid <
luca.moritz.sch...@gmail.com> wrote:

> Hey Vipin,
>
> here is some information to hier blocks
> <https://wiki.gnuradio.org/index.php/TutorialsWritePythonApplications#Hierarchical_blocks>
> from the GNU Radio wiki.
>
> If your structure of A_Func is that simple, I think its the best way to
> write the hier block by hand.
>
> When you implement B_Func and C_Func in gr blocks, you have to change your
> A_Func code anyway because you call instances of classes instead of
> functions.
>
> Don't worry about modifying the flow graph. There are multiple methods
> next to connect() (like wait(), unlock(), ..). It is no problem to do flow
> graph controlling inside an if statement. You can read more about
> controlling flow graphs here
> <https://wiki.gnuradio.org/index.php/TutorialsWritePythonApplications#Controlling_flow_graphs>
> .
>
>
> If any questions while creating the hier block occur, just ask.
>
>
> Best regards
>
> Luca
>
> On 24.05.2017 09:06, Vipin Sharma wrote:
>
> Thanks Luca.
>
> I may need a pointer to creating hierarchical python blocks using
> gr_modtool.
>
> My application's A_Func is mostly a control flow logic which simply calls
> the appropriate B_Func or C_Func depending on certain conditions. The other
> job of the A_Func is to pass along the input data stream to these sub
> functions. This, A_Func, of course is very easy to code in Matlab. I was
> trying to find an automated way to capture the Matlab control flow logic in
> GRC. It looks like I have two options (both manual):
> 1) Mimic Matlab's A_Func in Python (hierarchical block). I hope this way
> of doing things still gives me the ability to probe waveforms at the output
> of B_Func for example.
> 2) Mimic Matlab's A_Func in GRC GUI using the in built basic blocks. Not
> sure how I will code if/else controls in GRC GUI though. Any pointers
> appreciated.
> 3) Any other idea?
>
> Vipin
>
>
> On Tue, May 23, 2017 at 11:51 PM Moritz Luca Schmid <
> luca.moritz.sch...@gmail.com> wrote:
>
>> Hi Vipin,
>>
>> The question I have is this: A_Func calls B_Func and C_Func. I don’t
>> think I can instantiate the three custom blocks directly in one GRC
>> flow-graph. What will happen to the function call made in A_Func for B_Func
>> when A_Func custom block is kicked off for execution by the GRC scheduler?
>> Is there any way in GRC to define hierarchical custom blocks?
>>
>> There are hierarchical blocks in GNU Radio, but only for python. If your
>> A_Func logic is relatively straight forward calling the other functions,
>> you can try create a python hier block (you can do this with gr_modtool as
>> well). But if the function calls don't relate to the data flow, it makes no
>> sense to create different blocks for each function in my opinion. Remember
>> that a GR block should fulfill one logical signal processing step. If your
>> functions separately don't do that, defining multiple methods in your class
>> of the block is better way to do it.
>>
>> One way to solve this issue is the have Matlab Coder dump all code in one
>> C++ file and then simply create one giant custom block to instantiate in
>> GRC gui. Problem is that I won’t be able to debug in GRC gui very well
>> (granularity of probe points would be severally limited).
>>
>> Anyway, I think it depends on the structure and purpose of your different
>> functions. Are they each executing a signal processing step themselves or
>> is only the ensemble of the three functions one logical signal processing.
>> In the latter case I would implement the three functions in one block.
>>
>>
>> Best
>> Luca
>>
>
>
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to