discuss-gnuradio
[Top][All Lists]
Advanced

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

RE: [Discuss-gnuradio] Using a custom block


From: Kurt Holmquist
Subject: RE: [Discuss-gnuradio] Using a custom block
Date: Mon, 12 Apr 2010 19:32:57 -0400


Thank you for the response.

I would like to use as GRC blocks the blocks that I create as described in "How 
to Write a Signal Processing Block".  This is a somewhat unconventional 
situation in that I need a way for an "installed" application (i. e. grc) to 
use a locally created component, sort of the opposite of the normal situation.  
I think the XML file for the block should look something like:

<?xml version="1.0"?>
<block>
  <name>Square2</name>
  <key>howto_square2_ff</key>
  <category>HOWTO</category>
  <import>import howto</import>
  <make>howto.square2_ff()</make>

  <sink>
    <name>in</name>
    <type>float</type>
  </sink>

  <source>
    <name>out</name>
    <type>float</type>
  </source>
</block>

When I copy this file into the directory where GRC stores the block XML files 
(/usr/local/share/gnuradio/grc/blocks), GRC makes a "Square2" block available 
for use.  However, when I attempt to execute a flow graph that includes this 
block, it fails as follows:

Generating: "/home/kurt/gnuradio/grc/wav_file_to_speaker.py"
Executing: "/home/kurt/gnuradio/grc/wav_file_to_speaker.py"

Traceback (most recent call last):
  File "/home/kurt/gnuradio/grc/wav_file_to_speaker.py", line 17, in <module>
    import howto
ImportError: No module named howto

*****************
Where I need help is that I don't know how to set up python and/or environment 
so that python can import these components.
*****************

Thanks again for any help you can provide.


----------------------------------------
> Date: Mon, 12 Apr 2010 09:36:57 +0200
> From: address@hidden
> To: address@hidden
> Subject: Re: [Discuss-gnuradio] Using a custom block
>
> On Sun, Apr 11, 2010 at 04:55:23PM -0400, Kurt Holmquist wrote:
>>
>>
>> I'm looking for some information or references on what to do _after_ doing 
>> everything in the "how to write a block" tutorial in order to be able to 
>> access this block from other GNU radio python programs, for example changes 
>> to environment variables or whatever will be needed.
>
> Is
> http://gnuradio.org/redmine/wiki/gnuradio/TutorialsWritePythonApplications
> enough? If not, perhaps your questions are too specific for a tutorial
> and you might want to ask them directly.
>
>> I also would like to know what to put into the  "from gnuradio import blks2" 
>> element in the GRC block XML file so that I can use my custom blocks in GRC.
>
> Have a look at how the GRC blocks are defined in gr-howto..., that
> should clear things up.
> Good luck,
>
> MB
>
> --
> Karlsruhe Institute of Technology (KIT)
> Communications Engineering Lab (CEL)
>
> Dipl.-Ing. Martin Braun
> Research Associate
>
> Kaiserstraße 12
> Building 05.01
> 76131 Karlsruhe
>
> Phone: +49 721 608-3790
> Fax: +49 721 608-6071
> www.cel.kit.edu
>
> KIT -- University of the State of Baden-Württemberg and
> National Laboratory of the Helmholtz Association
>
                                          



reply via email to

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